Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id CD14A47724D for ; Sat, 16 Mar 2002 17:19:46 -0500 (EST) 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 g2GMJWS15916; Sat, 16 Mar 2002 17:19:32 -0500 (EST) To: dan@langille.org Cc: pgsql-sql Subject: Re: why the big difference on this explain analyze? In-reply-to: <20020316220751.A5EE73F28@bast.unixathome.org> References: <20020316220751.A5EE73F28@bast.unixathome.org> Comments: In-reply-to "Dan Langille" message dated "Sat, 16 Mar 2002 17:07:49 -0500" Date: Sat, 16 Mar 2002 17:19:32 -0500 Message-ID: <15913.1016317172@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200203/216 X-Sequence-Number: 7095 "Dan Langille" writes: > The difference between the two SQL statements is the inclusion of > Ports_Check in the WHERE EXISTS select clause. Which caused it to do the wrong thing. I think you'll find this command set found_in_ports = TRUE in *every* row of Ports_Check. Reason: the EXISTS clause no longer depends on the outer update, but evaluates to a constant TRUE. (Or possibly a constant FALSE, but that seems unlikely.) regards, tom lane