Skip site navigation (1) Skip section navigation (2)

Re: Any better plan for this query?..

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Dimitri <dimitrik(dot)fr(at)gmail(dot)com>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Dimitri Fontaine <dfontaine(at)hi-media(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Aidan Van Dyk <aidan(at)highrise(dot)ca>, Merlin Moncure <mmoncure(at)gmail(dot)com>, PostgreSQL Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Any better plan for this query?..
Date: 2009-05-19 12:58:25
Message-ID: 13070.1242737905@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
Simon Riggs <simon(at)2ndQuadrant(dot)com> writes:
> Both plans for this query show an IndexScan on a two column-index, with
> an Index Condition of equality on the leading column. The ORDER BY
> specifies a sort by the second index column, so the top-level Sort is
> superfluous in this case.

> My understanding is that we don't currently eliminate superfluous
> additional sorts of this kind.

Nonsense.  The planner might think some other plan is cheaper, but
it definitely knows how to do this, and has since at least 8.1.

			regards, tom lane

In response to

Responses

pgsql-performance by date

Next:From: Merlin MoncureDate: 2009-05-19 13:05:01
Subject: Re: Any better plan for this query?..
Previous:From: Matthew WakelingDate: 2009-05-19 12:01:43
Subject: Re: Any better plan for this query?..

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group