Re: [GENERAL] Seeking performance advice: Index for "recent entries"

2012-05-09 Thread Chris Angelico
On Thu, May 10, 2012 at 12:36 AM, Tom Lane wrote: > Chris Angelico writes: >> On Wed, May 9, 2012 at 2:52 PM, Tom Lane wrote: >>> I think this falls under the rubric of "premature optimization is the >>> root of all evil".  Just use a plain index on the timestamptz column >>> and be happy.  Sear

Re: [GENERAL] Seeking performance advice: Index for "recent entries"

2012-05-09 Thread Tom Lane
Chris Angelico writes: > On Wed, May 9, 2012 at 2:52 PM, Tom Lane wrote: >> I think this falls under the rubric of "premature optimization is the >> root of all evil".  Just use a plain index on the timestamptz column >> and be happy.  Searches that only look at the extremal values of a >> column

Re: [GENERAL] Seeking performance advice: Index for "recent entries"

2012-05-08 Thread Chris Angelico
On Wed, May 9, 2012 at 2:52 PM, Tom Lane wrote: > Chris Angelico writes: >> I have a table with a timestamptz column for the "effective date/time" >> of the row, and need to have some queries that look only for those >> entries for which that is in the future or VERY recently - which will >> be a

Re: [GENERAL] Seeking performance advice: Index for "recent entries"

2012-05-08 Thread Tom Lane
Chris Angelico writes: > I have a table with a timestamptz column for the "effective date/time" > of the row, and need to have some queries that look only for those > entries for which that is in the future or VERY recently - which will > be a small minority of rows. I'm looking at something like:

[GENERAL] Seeking performance advice: Index for "recent entries"

2012-05-08 Thread Chris Angelico
I have a table with a timestamptz column for the "effective date/time" of the row, and need to have some queries that look only for those entries for which that is in the future or VERY recently - which will be a small minority of rows. I'm looking at something like: CREATE INDEX on tablename (eff