Re: Changing location of ORDER BY has large effect on performance, but not results... - Mailing list pgsql-sql

From Tom Lane
Subject Re: Changing location of ORDER BY has large effect on performance, but not results...
Date
Msg-id 13380.1131115678@sss.pgh.pa.us
Whole thread Raw
In response to Changing location of ORDER BY has large effect on performance, but not results...  (Jason Turner <lefticus@gmail.com>)
List pgsql-sql
Jason Turner <lefticus@gmail.com> writes:
> My initial guess is that it is not able to utilize the index on
> foo.tracktitle to sort the result set after foo has been joined with
> other tables.

Well, of course not.  It should be able to do it before, though, and I'm
a bit surprised that you didn't get the same plan from both cases seeing
that the planner knows the first one is cheaper.  Can you provide a
complete self-contained test case?  I'm not interested in trying to
reverse-engineer your table definitions ...
        regards, tom lane


pgsql-sql by date:

Previous
From: Richard Huxton
Date:
Subject: Re: JOIN condition confusion
Next
From: Andreas Kretschmer
Date:
Subject: Re: serial in output