Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 8D08A9F9775 for ; Sun, 9 Sep 2007 22:29:10 -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 31888-06 for ; Sun, 9 Sep 2007 22:28:59 -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 1AEC29F973D for ; Sun, 9 Sep 2007 22:29:04 -0300 (ADT) Received: (qmail 10200 invoked from network); 10 Sep 2007 01:29:02 -0000 Received: from unknown (HELO boffin.xmtservices.net) (192.168.0.23) by errol.xmtservices.net with SMTP; 10 Sep 2007 01:29:02 -0000 Date: Sun, 9 Sep 2007 18:31:13 -0700 From: Shawn To: pgsql-performance@postgresql.org Subject: Re: Slow Query Message-ID: <20070909183113.4f90d9d0@boffin.xmtservices.net> In-Reply-To: <6471.1188868206@sss.pgh.pa.us> References: <20070901102947.0c0a50a3@boffin.xmtservices.net> <46DA9522.EE98.0025.0@wicourts.gov> <20070903091558.0780b963@boffin.xmtservices.net> <46DC071D.EE98.0025.0@wicourts.gov> <20070903165334.0da769c1@boffin.xmtservices.net> <6184.1188866982@sss.pgh.pa.us> <20070903180639.54afff8d@boffin.xmtservices.net> <6471.1188868206@sss.pgh.pa.us> X-Mailer: Claws Mail 3.0.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/155 X-Sequence-Number: 26700 On Mon, 03 Sep 2007 21:10:06 -0400 Tom Lane wrote: > Shawn writes: > > You weren't kidding, that really made a difference. its .5 sec now > > on the run. I think the vacuuming not running for a few weeks is > > what got me. I caught an edit that had stopped the vacuuming > > routine a while back. That must have been what caused the index > > bloat. > > Hmm, but no vacuuming at all would have allowed the table itself to > bloat too. Did you do a VACUUM FULL to recover after you noticed > the size problem? The trouble with VACUUM FULL is it compresses the > table but doesn't do a dang thing for indexes ... > > regards, tom lane > Thanks again to the list. I ran the reindex command that Tom suggested and things seem to be holding. Even the vacuum command is running faster. The whole script runs in about 10 seconds, far more acceptable. Thanks Guys! Shawn