Re: Tuning to speed select - Mailing list pgsql-general

From Michael Fuhr
Subject Re: Tuning to speed select
Date
Msg-id 20060810153452.GA17065@winnie.fuhr.org
Whole thread Raw
In response to Re: Tuning to speed select  (Tom Laudeman <twl8n@virginia.edu>)
Responses Re: Tuning to speed select
List pgsql-general
On Thu, Aug 10, 2006 at 11:00:00AM -0400, Tom Laudeman wrote:
> As far as I can tell (from running actual tests) Postgres will not use a
> multi-column index when the SELECT is constraining on only one of the
> columns in the index.

Excerpt from the 8.1 Release Notes:

  * Allow nonconsecutive index columns to be used in a multicolumn
    index (Tom)

    For example, this allows an index on columns a,b,c to be used in
    a query with WHERE a = 4 and c = 10.

If you're querying only on c then an index on (a,b,c) will probably
be slower than an index on (c), but if you have only (a,b,c) then
the planner will consider using it.

--
Michael Fuhr

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: CURRENT_TIMESTAMP wierd behaviour
Next
From: Tom Lane
Date:
Subject: Re: Tuning to speed select