Re: Changing location of ORDER BY has large effect on performance, but not results...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jason Turner <lefticus(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Changing location of ORDER BY has large effect on performance, but not results...
Date: 2005-11-04 14:47:58
Message-ID: 13380.1131115678@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Jason Turner <lefticus(at)gmail(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message James Robinson 2005-11-04 15:11:36 Re: Design question: Scalability and tens of thousands of tables?
Previous Message Harald Fuchs 2005-11-04 14:03:01 Re: serial in output