X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 74A46475F16 for ; Wed, 23 Apr 2003 13:12:47 -0400 (EDT) Received: from rtlocal.trade-india.com (mail-relay.trade-india.com [203.196.129.235]) by postgresql.org (Postfix) with SMTP id 970C1474E42 for ; Wed, 23 Apr 2003 13:12:35 -0400 (EDT) Received: (qmail 18591 invoked from network); 23 Apr 2003 17:12:31 -0000 Received: from unknown (HELO www.trade-india.com) (unknown) by unknown with SMTP; 23 Apr 2003 17:12:31 -0000 Received: (qmail 30738 invoked by uid 99); 23 Apr 2003 17:12:26 -0000 Received: from 219.65.233.8 (SquirrelMail authenticated user mallah) by mail.trade-india.com with HTTP; Wed, 23 Apr 2003 22:42:26 +0530 (IST) Message-ID: <1248.219.65.233.8.1051117946.squirrel@mail.trade-india.com> Date: Wed, 23 Apr 2003 22:42:26 +0530 (IST) Subject: Re: Why is seq search preferred here by planner? From: To: In-Reply-To: <200304231000.20578.josh@agliodbs.com> References: <1220.219.65.235.51.1051114881.squirrel@mail.trade-india.com> <200304231000.20578.josh@agliodbs.com> X-Priority: 3 Importance: Normal X-MSMail-Priority: Normal Cc: X-Mailer: SquirrelMail (version 1.2.6) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, hits=-24.7 required=5.0 tests=BAYES_10,IN_REP_TO,MISSING_MIMEOLE,MISSING_OUTLOOK_NAME, NO_REAL_NAME,QUOTED_EMAIL_TEXT,QUOTE_TWICE_1,REFERENCES, REPLY_WITH_QUOTES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/327 X-Sequence-Number: 13028 > Mallah, > >> UPDATE email_bank set country=3Dpersonal_account_details.country where u= serid >> > 0 and userid=3Dpersonal_account_details.userid ; > > While Postgres is letting you "fudge", you are missing part of that SQL = statement. It should > be: > > UPDATE email_bank set country=3Dpersonal_account_details.country > FROM personal_account_details > where userid > 0 and userid=3Dpersonal_account_details.userid ; yes this is the proper SQL , but that also works and have same results. > >> tradein_clients=3D# begin work;explain analyze UPDATE email_bank set >> country=3Dpersonal_account_details.country where userid > 0 and >> userid=3Dpersonal_account_details.userid ;BEGIN >> Time: 669.57 ms > > Hmmm ... 669 ms seems pretty speedy for updating 150,000 rows. What's t= he problem? Hmm i am not running postgresql on a CRAY :-) that was the time for "begin work;" since i am explain analysing an update i am putting it in transaction. the actualt time was nearing 300 secs which is 5 mins i did an explain of the UPDATE FROM variant of the query it has the same plan for it. regds mallah. > > -- > Josh Berkus > Aglio Database Solutions > San Francisco ----------------------------------------- Get your free web based email at trade-india.com. "India's Leading B2B eMarketplace.!" http://www.trade-india.com/