Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fBH6iCm63171 for ; Mon, 17 Dec 2001 01:44:12 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id fBH6i3i29733; Mon, 17 Dec 2001 01:44:03 -0500 (EST) To: "Christopher Kings-Lynne" cc: "Stephan Szabo" , "MindTerm" , pgsql-sql@postgresql.org Subject: Re: 'IN' performance In-reply-to: References: Comments: In-reply-to "Christopher Kings-Lynne" message dated "Mon, 17 Dec 2001 14:33:40 +0800" Date: Mon, 17 Dec 2001 01:44:03 -0500 Message-ID: <29730.1008571443@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200112/178 X-Sequence-Number: 6001 "Christopher Kings-Lynne" writes: > That's what I was thinking...where abouts does all that activity happen? The infrastructure for different join rules already exists. There'd need to be a new JOIN_xxx type added to the various join nodes in the executor, but AFAICS that's just a minor extension. The part that is perhaps not trivial is in the planner. All the existing inner and outer join types start out expressed as joins in the original query. To make IN into a join, the planner would have to hoist up a clause from WHERE into the join-tree structure. I think it can be done, but I have not thought hard about where and how, nor about what semantic restrictions might need to be checked. regards, tom lane