Re: merge>hash>loop

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ian Westmacott <ianw(at)intellivid(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: merge>hash>loop
Date: 2006-04-14 16:13:25
Message-ID: 10000.1145031205@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Ian Westmacott <ianw(at)intellivid(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2006-04-14 16:30:19 Re: Inserts optimization?
Previous Message Francisco Reyes 2006-04-14 16:10:12 Re: Inserts optimization?