Re: index on id and created_at

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Marcus Engene <mengpg2(at)engene(dot)se>
Cc: POSTGRESQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: index on id and created_at
Date: 2008-09-11 19:27:42
Message-ID: 20080911192742.GC15748@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Sep 11, 2008 at 06:08:15PM +0200, Marcus Engene wrote:
> In this select, it would have been nice to dodge the full table scan
> without adding an index to created_at. Is this possible somehow?

yes.
1. drop condition on created_at
2. run the query as cursor
3. fetch rows from cursor until you will get row that has unsatisfactory
created_at.

Best regards,

depesz

--
Linkedin: http://www.linkedin.com/in/depesz / blog: http://www.depesz.com/
jid/gtalk: depesz(at)depesz(dot)com / aim:depeszhdl / skype:depesz_hdl / gg:6749007

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Wilson 2008-09-11 19:38:43 Re: Psql command for rowcount
Previous Message Markova, Nina 2008-09-11 19:19:18 Psql command for rowcount