X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id BAFEC11F732A for ; Mon, 3 Apr 2006 18:58:13 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 64059-03 for ; Mon, 3 Apr 2006 18:58:13 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 65D5411F7329 for ; Mon, 3 Apr 2006 18:58:11 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k33Lw294017163; Mon, 3 Apr 2006 17:58:02 -0400 (EDT) To: "Mike Quinn" cc: pgsql-performance@postgresql.org Subject: Re: The order of fields around the "=" in the WHERE conditions In-reply-to: <44313030020000E5000001DA@dp_mail.co.merced.ca.us> References: <44313030020000E5000001DA@dp_mail.co.merced.ca.us> Comments: In-reply-to "Mike Quinn" message dated "Mon, 03 Apr 2006 14:24:48 -0700" Date: Mon, 03 Apr 2006 17:58:02 -0400 Message-ID: <17162.1144101482@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.114 required=5 tests=[AWL=0.114] X-Spam-Score: 0.114 X-Spam-Level: X-Archive-Number: 200604/35 X-Sequence-Number: 18119 "Mike Quinn" writes: > -- The order of fields around the "=" in the WHERE conditions > -- affects the query plan. BTW, what's the datatype(s) of the join columns? The behavior looks consistent with the idea that the planner doesn't think it can commute the join conditions, which would be a bug/omission in the set of operators existing for the datatype(s). I believe we've got commutators for all the standard '=' operators, but a contrib or third-party datatype might be missing this. regards, tom lane