Received: from shaked.cc.openu.ac.il (shaked.cc.openu.ac.il [147.233.145.65]) by hub.org (8.9.1/8.9.1) with ESMTP id LAA08453 for ; Mon, 23 Nov 1998 11:35:36 -0500 (EST) (envelope-from herouth@oumail.openu.ac.il) Received: from [147.233.159.109] (herouth@mac-herouth.pc.openu.ac.il [147.233.159.109]) by shaked.cc.openu.ac.il (8.8.8/8.8.8) with ESMTP id SAA11430 for ; Mon, 23 Nov 1998 18:35:31 +0200 (IST) X-Sender: herouth@shaked.cc.openu.ac.il Message-Id: In-Reply-To: <18394.911837459@sss.pgh.pa.us> References: Your message of Sun, 22 Nov 1998 23:00:20 -0500 (EST) <199811230400.XAA04611@hub.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Mon, 23 Nov 1998 18:36:26 +0200 To: pgsql-sql@postgreSQL.org From: Herouth Maoz Subject: Re: [SQL] optimizing 2-table join w/millions of rows At 18:10 +0200 on 23/11/98, Tom Lane wrote: > Here, indexes on the part number would be stressed. You'd have to > experiment to see which is faster on your data. (As far as I know, > the Postgres optimizer will always evaluate your AND clauses left to > right, which means that the key to performance is to make the leftmost > clause reject as large a fraction of candidate rows as possible.) I thought the optimizer canonized the where clause into an ANDing of ORs, and then sought the best solution. That is, that the order of the clauses did not matter, because the optimizer would know that comparison to a literal on an indexed column is better than comparison to a field. Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma