pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Richard Huxton <dev@archonet.com>
Cc: Joel Fradkin <jfradkin@wazagua.com>
Cc: PostgreSQL Perform <pgsql-performance@postgresql.org>
Subject: Re: speed of querry?
Date: Thu, 14 Apr 2005 02:47:06 -0400
Message-ID: <27509.1113461226@sss.pgh.pa.us> (raw)
In-Reply-To: <425D573B.3080208@archonet.com>
References: <001b01c54036$d49a2290$797ba8c0@jfradkin>
	<425D573B.3080208@archonet.com>

Richard Huxton <dev@archonet.com> writes:
> In the first, we match outer.clientnum to inner.clientnum, in the second 
> it's "?column10?" - are you sure the query was identical in each case. 
> I'm guessing the unidentified column in query 2 is the reason for the 
> sort a couple of lines below it, which seems to take up a large chunk of 
> time.

The "?column10?" is because EXPLAIN isn't excessively bright about
reporting references to outputs of lower plan nodes.  (Gotta fix that
sometime.)  The real point here is that the planner thought that a scan
plus sort would be faster than scanning an index that exactly matched
the sort order the Merge Join needed ... and it was wrong :-(

So this is just the usual sort of question of "are your stats up to
date, maybe you need to increase stats targets, or else play with
random_page_cost, etc" ...

			regards, tom lane



view thread (22+ messages)  latest in thread

Message-ID: <27509.1113461226@sss.pgh.pa.us>
Permalink:  ../27509.1113461226@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/27509.1113461226@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-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dev@archonet.com, jfradkin@wazagua.com
  Subject: Re: speed of querry?
  In-Reply-To: <27509.1113461226@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