Re: Seeking performance advice: Index for "recent entries"

From: Chris Angelico <rosuav(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Seeking performance advice: Index for "recent entries"
Date: 2012-05-09 14:56:56
Message-ID: CAPTjJmpswYXqSNb0NhtCwwJ4EJsV8mpfmxyru5iKbCTxnCO0Qw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, May 10, 2012 at 12:36 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Chris Angelico <rosuav(at)gmail(dot)com> writes:
>> On Wed, May 9, 2012 at 2:52 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> 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 work perfectly well with a full index, because they only need to
>>> examine a small range of the index.
>
>> The index is actually on two columns, an account ID followed by the
>> effective date - I need to look up whether any particular account has
>> recent entries. Does that make any difference?
>
> Should still work all right, though you might want to check plans and
> timings on some test data to be sure.

Thank you! Much appreciated.

ChrisA

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2012-05-09 15:08:03 Re: Strange crash logs
Previous Message Tom Lane 2012-05-09 14:36:33 Re: Seeking performance advice: Index for "recent entries"