pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Mark Kirkwood <markir@paradise.net.nz>
Cc: Tobias Brox <tobias@nordicbet.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Limit + group + join
Date: Fri, 26 Aug 2005 11:46:33 -0400
Message-ID: <9501.1125071193@sss.pgh.pa.us> (raw)
In-Reply-To: <430E85ED.60109@paradise.net.nz>
References: <20050826002709.GK10328@tobias.lan>
	<430E85ED.60109@paradise.net.nz>

Mark Kirkwood <markir@paradise.net.nz> writes:
> What is interesting is why this plan is being rejected...

Which PG version are you using exactly?  That mistake looks like an
artifact of the 8.0 "fuzzy plan cost" patch, which we fixed recently:
http://archives.postgresql.org/pgsql-committers/2005-07/msg00474.php

But Tobias wasn't happy with 7.4 either, so I'm not sure that the fuzzy
cost issue explains his results.

As far as the "desc" point goes, the problem is that mergejoins aren't
capable of dealing with backward sort order, so a merge plan isn't
considered for that case (or at least, it would have to have a sort
after it, which pretty much defeats the point for a fast-start plan).
I have some ideas about fixing this but it won't happen before 8.2.

			regards, tom lane



view thread (17+ messages)  latest in thread

Message-ID: <9501.1125071193@sss.pgh.pa.us>
Permalink:  ../9501.1125071193@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/9501.1125071193@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, markir@paradise.net.nz, tobias@nordicbet.com
  Subject: Re: Limit + group + join
  In-Reply-To: <9501.1125071193@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