pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jason Turner <lefticus@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Changing location of ORDER BY has large effect on performance, but not results...
Date: Fri, 04 Nov 2005 09:47:58 -0500
Message-ID: <13380.1131115678@sss.pgh.pa.us> (raw)
In-Reply-To: <58e14cf00510281430y172deecak32839c101608522d@mail.gmail.com>
References: <58e14cf00510281430y172deecak32839c101608522d@mail.gmail.com>

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



view thread (2+ messages)

Message-ID: <13380.1131115678@sss.pgh.pa.us>
Permalink:  ../13380.1131115678@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13380.1131115678@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, lefticus@gmail.com
  Subject: Re: Changing location of ORDER BY has large effect on performance, but not results...
  In-Reply-To: <13380.1131115678@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox