Re: Join method influences scan method?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: mark(dot)lubratt(at)indeq(dot)com
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Join method influences scan method?
Date: 2005-03-17 06:41:15
Message-ID: 20910.1111041675@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

mark(dot)lubratt(at)indeq(dot)com writes:
> So, it would seem like my optimal plan should have hash joins with index
> scans.

No. The thing you are looking at here is a nestloop join with inner
index scan, which has to be understood as a unit even though EXPLAIN
doesn't describe it that way. The inner indexscan is repeated once
for each outer row, using a join key from the outer row as part of the
index lookup. That's simply not relevant to the other kinds of joins,
because they expect the inner and outer relations to be scanned
independently.

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Manfred Koizar 2005-03-17 08:12:42 Re: index scan on =, but not < ?
Previous Message mark.lubratt 2005-03-17 06:16:24 Join method influences scan method?