Re: query should use an index? - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: query should use an index?
Date
Msg-id 200401101057.25325.peter_e@gmx.net
Whole thread Raw
In response to query should use an index?  (Bopolissimus Platypus <bopolissimus@sni.ph>)
List pgsql-general
Bopolissimus Platypus wrote:
> create table test (
>   id serial primary key,
>   t_end timestamp);
>
> there's an index:
>   create index test_t_end on test(t_end);
>
> can or should a query like:
>
>   select login,t_end from test order by t_end desc;
>
> use the index?

It can, but that does not mean that it is unconditionally the best
choice.  The planner will make the decision.


pgsql-general by date:

Previous
From: Bopolissimus Platypus
Date:
Subject: query should use an index?
Next
From: Anton.Nikiforov@loteco.ru
Date:
Subject: Re: Hierarchical queries