Re: Need advice to avoid ORDER BY - Mailing list pgsql-general

From John R Pierce
Subject Re: Need advice to avoid ORDER BY
Date
Msg-id 515DF9AD.5000005@hogranch.com
Whole thread Raw
In response to Re: Need advice to avoid ORDER BY  (Condor <condor@stz-bg.com>)
List pgsql-general
On 4/4/2013 2:49 PM, Condor wrote:
> Your solution is work, but Im now a little confused. I has a index
> CREATE INDEX ON mytable (valids) USING BTREE (valids) and the
> query to find valids = 0 tooks 137 ms.

the query can't use that index, and the separate index on id at the same
time, it has to pick one.

Merlin's partial index is how you get around this.

--
john r pierce                                      37N 122W
somewhere on the middle of the left coast



pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: Need advice to avoid ORDER BY
Next
From: Tom Lane
Date:
Subject: Re: Need advice to avoid ORDER BY