Re: Very ineffective plan with merge join

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: "Pgsql Hackers" <pgsql-hackers(at)postgresql(dot)org>, "Oleg Bartunov" <oleg(at)sai(dot)msu(dot)su>
Subject: Re: Very ineffective plan with merge join
Date: 2010-04-15 22:00:58
Message-ID: 25335.1271368858@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> writes:
> What's up with the sort of _accrged7200 (in the slower plan) taking
> in 3.5 million rows and putting out 1 row? There's something there
> I'm not understanding.

It's under a merge join, so what probably happened is that the first
row from that side had a larger key than any row from the other side.
A mergejoin will never bother to look at the remaining rows in such
a case.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-04-15 22:13:41 Re: Streaming replication and a disk full in primary
Previous Message Kevin Grittner 2010-04-15 21:33:52 Re: Very ineffective plan with merge join