pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ian Westmacott <ianw@intellivid.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: merge>hash>loop
Date: Fri, 14 Apr 2006 12:13:25 -0400
Message-ID: <10000.1145031205@sss.pgh.pa.us> (raw)
In-Reply-To: <1145029009.3422.31.camel@spectre.intellivid.com>
References: <1145029009.3422.31.camel@spectre.intellivid.com>

Ian Westmacott <ianw@intellivid.com> writes:
> I have this query, where PG (8.1.2) prefers Merge Join over Hash Join
> over Nested Loop.  However, this order turns out to increase in
> performance.  I was hoping someone might be able to shed some light on
> why PG chooses the plans in this order, and what I might do to
> influence it otherwise.  Thanks,

Reducing random_page_cost would influence it to prefer the nestloop.
However, I doubt you're ever going to get really ideal results for
this query --- the estimated row counts are too far off, and the
WHERE conditions are sufficiently bizarre that there's not much hope
that they'd ever be much better.

			regards, tom lane



view thread (16+ messages)  latest in thread

Message-ID: <10000.1145031205@sss.pgh.pa.us>
Permalink:  ../10000.1145031205@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10000.1145031205@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, ianw@intellivid.com
  Subject: Re: merge>hash>loop
  In-Reply-To: <10000.1145031205@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