Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 63CC59F9C7E for ; Sun, 2 Sep 2007 00:00:21 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 26812-05 for ; Sun, 2 Sep 2007 00:00:05 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 479499F9C70 for ; Sun, 2 Sep 2007 00:00:11 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l8230AV1025185; Sat, 1 Sep 2007 23:00:10 -0400 (EDT) To: Shawn cc: pgsql-performance@postgresql.org Subject: Re: Slow Query In-reply-to: <20070901173519.0ed11401@boffin.xmtservices.net> References: <20070901102947.0c0a50a3@boffin.xmtservices.net> <22800.1188670194@sss.pgh.pa.us> <20070901131816.3f7ef91a@boffin.xmtservices.net> <20070901173519.0ed11401@boffin.xmtservices.net> Comments: In-reply-to Shawn message dated "Sat, 01 Sep 2007 17:35:19 -0700" Date: Sat, 01 Sep 2007 23:00:10 -0400 Message-ID: <25184.1188702010@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/9 X-Sequence-Number: 26554 Shawn writes: > The query just ran and here is the basic output: > UPDATE 15445 > Time: 22121.141 ms > and > explain ANALYZE update shawns_data set alias = null; > QUERY PLAN > ----------------------------------------------------------------------------------------------------------------- > Seq Scan on shawns_data (cost=0.00..465.45 rows=15445 width=480) (actual time=0.034..67.743 rows=15445 loops=1) > Total runtime: 1865.002 ms > (2 rows) Hmmm ... did you run the real query and the EXPLAIN in immediate succession? If so, the only reason I can think of for the speed difference is that all the rows were fetched already for the second run. Which doesn't make a lot of sense given the hardware specs you mentioned. Try watching "vmstat 1" and see if there's some noticeable difference in the behavior. regards, tom lane