X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 6C02BD1B50E for ; Tue, 9 Sep 2003 08:08:07 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 49106-03 for ; Tue, 9 Sep 2003 05:07:58 -0300 (ADT) Received: from bosvwl01.infosys.com (bosvwl01.itlinfosys.com [216.52.49.35]) by svr1.postgresql.org (Postfix) with SMTP id 1B4F1D1B502 for ; Tue, 9 Sep 2003 05:07:56 -0300 (ADT) Received: from 192.168.200.81 by bosvwl01.infosys.com (InterScan E-Mail VirusWall NT); Tue, 09 Sep 2003 04:05:41 -0400 Received: from mysmsg01.ad.infosys.com ([192.168.124.3]) by indhubbhs01.ad.infosys.com with Microsoft SMTPSVC(5.0.2195.5329); Tue, 9 Sep 2003 13:39:10 +0530 Received: from mysmsg03.ad.infosys.com ([192.168.223.4]) by mysmsg01.ad.infosys.com with Microsoft SMTPSVC(5.0.2195.5329); Tue, 9 Sep 2003 13:39:10 +0530 X-MimeOLE: Produced By Microsoft Exchange V6.0.6375.0 content-class: urn:content-classes:message Subject: How can I optimize this query MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Tue, 9 Sep 2003 13:39:10 +0530 Message-ID: <284E845CC8F394409203F065D218205C044896@mysmsg03.ad.infosys.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: How can I optimize this query Thread-Index: AcN2qaWEgrRv/+hWRRueFxFeYMp8uQ== From: "Jainendra Kumar P" To: X-OriginalArrivalTime: 09 Sep 2003 08:09:10.0586 (UTC) FILETIME=[A62A81A0:01C376A9] X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests=BAYES_30, RCVD_IN_OSIRUSOFT_COM X-Spam-Level: X-Archive-Number: 200309/70 X-Sequence-Number: 15048 I have the following query UPDATE accumulator1 SET accumulator1.status =3D "User Excluded" WHERE accumulator1.name NOT IN (SELECT DISTINCT accumulator1.name FROM accumulator1, diaaffectedstmts WHERE diaaffectedstmts.stmt like '*'+ accumulator1.name +'*' and diaaffectedstmts.xref_type <>=20=20 "D"); How can I optimize this query? Thanks Jain