Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id E9BBD476E64 for ; Thu, 27 Jun 2002 23:57:34 -0400 (EDT) Mailbox-Line: From tgl@sss.pgh.pa.us Thu Jun 27 23:57:34 2002 Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 9864D476993 for ; Thu, 27 Jun 2002 23:54:51 -0400 (EDT) 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 g5S3qej02370; Thu, 27 Jun 2002 23:52:40 -0400 (EDT) To: Keith Gray Cc: Masaru Sugawara , Alvar Freude , pgsql-sql@postgresql.org Subject: Re: 2 Selects 1 is faster, why? In-reply-to: <3D1BA27E.9000802@heart.com.au> References: <1371510000.1025105687@gnarzelwicht.delirium-arts.de> <20020627234531.7ECB.RK73@sea.plala.or.jp> <3D1BA27E.9000802@heart.com.au> Comments: In-reply-to Keith Gray message dated "Fri, 28 Jun 2002 09:40:46 +1000" Date: Thu, 27 Jun 2002 23:52:40 -0400 Message-ID: <2367.1025236360@sss.pgh.pa.us> From: Tom Lane X-Spam-Status: No, hits=-5.4 required=5.0 tests=IN_REP_TO,X_NOT_PRESENT,SUBJ_ENDS_IN_Q_MARK version=2.30 X-Spam-Level: X-Archive-Number: 200206/379 X-Sequence-Number: 8344 Keith Gray writes: > ...but is it true that if you place the filter clause first, > the join will not have to complete the whole table? PG's planner does not pay attention to the ordering of WHERE clauses; it will do what it thinks best with them in any case. regards, tom lane