Re: Forcing use of indexes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pedro Alves <pmalves(at)think(dot)pt>
Cc: PostGreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: Forcing use of indexes
Date: 2003-04-02 15:36:35
Message-ID: 21230.1049297795@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Pedro Alves <pmalves(at)think(dot)pt> writes:
> On Wed, Apr 02, 2003 at 09:52:19AM -0500, Tom Lane wrote:
>> Presently, you'd need an index on (bar,foo) to get a good plan for a
>> query expressed that way.

> Thats what I meant when I said 'I have a composite index in columns foo
> and bar'. In the second query, it doesn't this index.

An index on (foo,bar) isn't equivalent to one on (bar,foo).

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dennis Gearon 2003-04-02 16:21:53 Re: Earth distance
Previous Message Tom Lane 2003-04-02 15:35:23 Re: [SQL] error: lost syncronization with server