Re: Multiple column index question. - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: Multiple column index question.
Date
Msg-id 20070120013924.GB30390@wolff.to
Whole thread Raw
In response to Multiple column index question.  ("Jan Muszynski" <jan@jancm.org>)
List pgsql-general
On Fri, Jan 19, 2007 at 15:22:12 -0500,
  Jan Muszynski <jan@jancm.org> wrote:
> If I have an index that's composed of 2 columns:
>     Index index1 on tableA (foo,bar)
>
> and I then:
>     Select cola, colb from tableA where foo=<value>
>
> Will index1 still be used, or am I looking at a seqscan under all
> circumstances in this case?

The planner can decide to use it. It may not always use it though depending
on what it thinks the costs of the various ways to do the query are.

pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Password encryption method
Next
From: Ron Peterson
Date:
Subject: lanmanager and ntlm hash function contribution