Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g0M4nMl32567 for ; Mon, 21 Jan 2002 23:49:22 -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 g0M4nPf12910; Mon, 21 Jan 2002 23:49:25 -0500 (EST) To: raja kumar thatte cc: pgsql-admin@postgresql.org Subject: Re: Any body know --- 'sql query where condition execution plan' In-reply-to: <20020122035909.84067.qmail@web20609.mail.yahoo.com> References: <20020122035909.84067.qmail@web20609.mail.yahoo.com> Comments: In-reply-to raja kumar thatte message dated "Mon, 21 Jan 2002 19:59:09 -0800" Date: Mon, 21 Jan 2002 23:49:25 -0500 Message-ID: <12907.1011674965@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200201/134 X-Sequence-Number: 3021 raja kumar thatte writes: > I want to know how the--where condition--is executed in a sql query. > e.g., select aa,bb,cc from ttt where aa=100 and bb = 200 and cc =300. > my doubt is , will psql leave the record as on when it fails to satisfy a record having aa !=100 > or will it chect for bb = 200 and cc = 300 also. > ie will it work like C-language if condition or not. > If i give paranthesis, will it change the execution plan accordingly. The planner will make its own decisions about which query plan to follow; it's quite impervious to parentheses, clause order, or any other semantically-insignificant details in the WHERE clause. You may care to read the chapter on performance tips in the User's Guide. regards, tom lane