Re: Query planner unaware of possibly best plan - Mailing list pgsql-performance

From Tom Lane
Subject Re: Query planner unaware of possibly best plan
Date
Msg-id 9259.1190441248@sss.pgh.pa.us
Whole thread Raw
In response to Re: Query planner unaware of possibly best plan  (Denes Daniel <panther-d@freemail.hu>)
Responses Re: Query planner unaware of possibly best plan  (Denes Daniel <panther-d@freemail.hu>)
List pgsql-performance
Denes Daniel <panther-d@freemail.hu> writes:
> Simon Riggs <simon@2ndquadrant.com> wrote:
>> Make the case. **I** want it is not sufficient...

> Sorry, I can't understand that... I'm far from perfect in english.

The point here is that you've repeated the same example N times without
actually making a case that it's interesting to support.  We have to
think about the intellectual complexity that would be added to the
planner to support this case, and the cycles that would be expended
on every query (and wasted, for most queries) on trying to detect
whether the case applies.  If it were simple and cheap to do, these
arguments wouldn't hold much weight, but it doesn't look to me like
either is the case.

Another problem is that it's not clear there's much to be gained.
Avoiding the sort step is only interesting if the query produces so many
rows that a sort would be expensive ... but if that's the case, it seems
unlikely that a nestloop indexscan plan would be the best choice anyway.

So basically this looks like a lot of work for a narrow and questionable
gain.  If you want it to happen you need to convince people that it's
easier and more useful than it looks.

            regards, tom lane

pgsql-performance by date:

Previous
From: Denes Daniel
Date:
Subject: Re: Query planner unaware of possibly best plan
Next
From: Greg Smith
Date:
Subject: Re: Low CPU Usage