Re: Why is index disregarded when querying a timestamp? - Mailing list pgsql-general

From Tom Lane
Subject Re: Why is index disregarded when querying a timestamp?
Date
Msg-id 25048.1025710334@sss.pgh.pa.us
Whole thread Raw
In response to Why is index disregarded when querying a timestamp?  ("Markus Wollny" <Markus.Wollny@computec.de>)
List pgsql-general
"Markus Wollny" <Markus.Wollny@computec.de> writes:
> I would like to know why this query here doesn't use the index on
> ct_com_board_message....

>     from        CT_COM_BOARD_MESSAGE    MESSAGE
>     where        (0=0)
>     and (MESSAGE.CREATED >= CURRENT_TIMESTAMP-1)
>                 LIMIT 500

That's not considered an indexable WHERE clause in current releases
(7.3 will fix this).  See past discussions about how to hide the
current_timestamp call in a function marked "isCachable".

            regards, tom lane



pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Why is index disregarded when querying a timestamp?
Next
From: Robert Treat
Date:
Subject: Re: README file for postgresql server upgrade