Re: timestamp indexing - Mailing list pgsql-performance

From Tom Lane
Subject Re: timestamp indexing
Date
Msg-id 24839.1117475874@sss.pgh.pa.us
Whole thread Raw
In response to Re: timestamp indexing  (Tobias Brox <tobias@nordicbet.com>)
Responses Re: timestamp indexing
List pgsql-performance
Tobias Brox <tobias@nordicbet.com> writes:
>> What version of PostgreSQL are you using?

> Also answered in my follow-up - "not yet pg8" :)

Your followup hasn't shown up here yet, but if the query is written like
    WHERE timestampcol >= now() - interval 'something'
then the pre-8.0 planner is not capable of making a good estimate of the
selectivity of the WHERE clause.  One solution is to fold the timestamp
computation to a constant on the client side.

            regards, tom lane

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Postgresql and xeon.
Next
From: Colton A Smith
Date:
Subject: poor performance involving a small table