Re: index on id and created_at - Mailing list pgsql-general

From Scott Marlowe
Subject Re: index on id and created_at
Date
Msg-id dcc563d10809111158u5185ba1bo4d84d086b99bc389@mail.gmail.com
Whole thread Raw
In response to index on id and created_at  (Marcus Engene <mengpg2@engene.se>)
List pgsql-general
On Thu, Sep 11, 2008 at 10:08 AM, Marcus Engene <mengpg2@engene.se> wrote:
> select
>   objectid
> from
>   apa
> where
>   created_at > now() - interval '1 day'
> order by
>   objectid desc;
>
> 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?

Not really.  It's a choice of one or the other.

pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: "Healing" a table after massive updates
Next
From: "Scott Marlowe"
Date:
Subject: Re: connection timeouts and "killing" users