Re: [HACKERS] Another optimizer question

2004-01-27 Thread Tom Lane
Rod Taylor <[EMAIL PROTECTED]> writes: >> As a more direct response, there *are* reasons for people to put ORDER >> BY in a subselect and expect it to be honored. The typical example >> that's been discussed several times in the archives is that you want to >> use an aggregate function that is sen

Re: [HACKERS] Another optimizer question

2004-01-27 Thread Rod Taylor
> As a more direct response, there *are* reasons for people to put ORDER > BY in a subselect and expect it to be honored. The typical example > that's been discussed several times in the archives is that you want to > use an aggregate function that is sensitive to the ordering of its input Not to

Re: [HACKERS] Another optimizer question

2004-01-27 Thread Tom Lane
Hannu Krosing <[EMAIL PROTECTED]> writes: > Dennis Haney kirjutas T, 27.01.2004 kell 21:08: >> I'm saying the sort makes no sense. So why even bother executing it? >> >>> why did you write it? >> >> I believe the most common scenario would be that the subquery was >> expanded from a view... > And

Re: [HACKERS] Another optimizer question

2004-01-27 Thread Hannu Krosing
Dennis Haney kirjutas T, 27.01.2004 kell 21:08: > Tom Lane wrote: > > Dennis Haney <[EMAIL PROTECTED]> writes: > > > > > There is no constraint on the order of 'a', so why is pull_up_subqueries > > > explicitly ignoring subqueries that contain an 'order by'? > > > > > Because there would

Re: [HACKERS] Another optimizer question

2004-01-27 Thread Dennis Haney
Tom Lane wrote: Dennis Haney <[EMAIL PROTECTED]> writes: There is no constraint on the order of 'a', so why is pull_up_subqueries explicitly ignoring subqueries that contain an 'order by'? Because there would be no place to apply the sort operation. Then why spend tim

Re: [HACKERS] Another optimizer question

2004-01-27 Thread Dennis Haney
Bruno Wolff III wrote: On Tue, Jan 27, 2004 at 17:27:25 +0100, Dennis Haney <[EMAIL PROTECTED]> wrote: Is it just me, or is there any way a sort could be relevant in a subquery? (except on queries containing volatile functions) Yes. It is important when a limit or dis

Re: [HACKERS] Another optimizer question

2004-01-27 Thread Tom Lane
Dennis Haney <[EMAIL PROTECTED]> writes: > There is no constraint on the order of 'a', so why is pull_up_subqueries > explicitly ignoring subqueries that contain an 'order by'? Because there would be no place to apply the sort operation. If you are saying you don't want the sort to occur, why di

Re: [HACKERS] Another optimizer question

2004-01-27 Thread Bruno Wolff III
On Tue, Jan 27, 2004 at 17:27:25 +0100, Dennis Haney <[EMAIL PROTECTED]> wrote: > > Is it just me, or is there any way a sort could be relevant in a > subquery? (except on queries containing volatile functions) Yes. It is important when a limit or distinct on clause is used in a subquery. ---

Re: [HACKERS] another optimizer question

2002-04-18 Thread Tom Lane
Jakub Ouhrabka <[EMAIL PROTECTED]> writes: > can anyone explain me why there are different query plans for "select ... > from ... where y!=x" and "select ... from ... where yx" for > integers, please? != isn't an indexable operation. This is not the planner's fault, but a consequence of the ind