Re: Tuning to speed select

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Tom Laudeman <twl8n(at)virginia(dot)edu>
Cc: Reece Hart <reece(at)harts(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: Tuning to speed select
Date: 2006-08-10 15:34:52
Message-ID: 20060810153452.GA17065@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-08-10 15:54:23 Re: Tuning to speed select
Previous Message Scott Marlowe 2006-08-10 15:33:42 Re: CURRENT_TIMESTAMP wierd behaviour