Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id CF6199F975B for ; Sat, 1 Sep 2007 17:17:00 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 48348-03 for ; Sat, 1 Sep 2007 17:16:57 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail.xmtservices.net (unknown [66.224.65.210]) by postgresql.org (Postfix) with SMTP id 60F3E9F9626 for ; Sat, 1 Sep 2007 17:16:57 -0300 (ADT) Received: (qmail 22466 invoked from network); 1 Sep 2007 20:16:55 -0000 Received: from unknown (HELO boffin.xmtservices.net) (192.168.0.23) by errol.xmtservices.net with SMTP; 1 Sep 2007 20:16:55 -0000 Date: Sat, 1 Sep 2007 13:18:16 -0700 From: Shawn To: pgsql-performance@postgresql.org Subject: Re: Slow Query Message-ID: <20070901131816.3f7ef91a@boffin.xmtservices.net> In-Reply-To: <22800.1188670194@sss.pgh.pa.us> References: <20070901102947.0c0a50a3@boffin.xmtservices.net> <22800.1188670194@sss.pgh.pa.us> X-Mailer: Claws Mail 2.10.0 (GTK+ 2.10.13; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/6 X-Sequence-Number: 26551 Hi Tom, Thanks for replying. There are no FK's, indexes, or dependents on the alias field. The system is in the middle of its weekly full activity log resync, about 600 Million records. It will be done later this evening and I will run the explain analyze thenand I will post the results. I will also run a vacuum full analyze on it before the run and have timing on. Shawn On Sat, 01 Sep 2007 14:09:54 -0400 Tom Lane wrote: > Shawn writes: > > update shawns_data set alias = null; > > > Alias is a type varchar(8) > > > The table has 26 fields per record and there are about 15,700 > > records. The server hardware is a dual QUAD-CORE Intel 2 GHz XEON > > dell 2950 server with 4 drive SAS RAID-5 array, and 16G of RAM. > > The OS is Slackware 11 with some updatews and Postgres v8.2.4 built > > from source. > > > Even after VACUUM this simple line takes 35 sec to complete. > > Seems like a lot. Table bloat maybe (what does VACUUM VERBOSE say > about this table)? An unreasonably large number of indexes to update? > Foreign key checks? (Though unless you have FKs pointing at alias, > I'd think 8.2 would avoid needing to make any FK checks.) > > Could we see EXPLAIN ANALYZE output for this operation? (If you don't > really want to zap the column right now, wrap the EXPLAIN in > BEGIN/ROLLBACK.) > > regards, tom lane > > ---------------------------(end of > broadcast)--------------------------- TIP 6: explain analyze is your > friend >