Re: Multiple column index question.

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Jan Muszynski <jan(at)jancm(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Multiple column index question.
Date: 2007-01-20 01:39:24
Message-ID: 20070120013924.GB30390@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jan 19, 2007 at 15:22:12 -0500,
Jan Muszynski <jan(at)jancm(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ron Peterson 2007-01-20 01:42:39 lanmanager and ntlm hash function contribution
Previous Message Bruno Wolff III 2007-01-20 01:35:46 Re: Password encryption method