X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B51C63A4537 for ; Wed, 3 Nov 2004 18:56:50 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 49909-09 for ; Wed, 3 Nov 2004 18:56:47 +0000 (GMT) Received: from web52105.mail.yahoo.com (web52105.mail.yahoo.com [206.190.39.74]) by svr1.postgresql.org (Postfix) with SMTP id 6D2ED3A4536 for ; Wed, 3 Nov 2004 18:56:47 +0000 (GMT) Message-ID: <20041103185647.87443.qmail@web52105.mail.yahoo.com> Received: from [198.182.200.22] by web52105.mail.yahoo.com via HTTP; Wed, 03 Nov 2004 10:56:47 PST Date: Wed, 3 Nov 2004 10:56:47 -0800 (PST) From: patrick ~ Subject: vacuum analyze slows sql query To: pgsql-performance@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/18 X-Sequence-Number: 8972 Greetings pgsql-performance :) Yesterday I posted to the pgsql-sql list about an issue with VACUUM while trying to track-down an issue with performance of a SQL SELECT statement invovling a stored function. It was suggested that I bring the discussion over to -performance. Instread of reposting the message here is a link to the original message followed by a brief summary: http://marc.theaimsgroup.com/?l=postgresql-sql&m=109945118928530&w=2 Summary: Our customer complains about web/php-based UI sluggishness accessing the data in db. I created a "stripped down" version of the tables in question to be able to post to the pgsql-sql list asking for hints as to how I can improve the SQL query. While doing this I noticed that if I 'createdb' and populate it with the "sanatized" data the query in question is quite fast; 618 rows returned in 864.522 ms. This was puzzling. Next I noticed that after a VACUUM the very same query would slow down to a crawl; 618 rows returned in 1080688.921 ms). This was reproduced on PostgreSQL 7.4.2 running on a Intel PIII 700Mhz, 512mb. This system is my /personal/ test system/sandbox. i.e., it isn't being stressed by any other processes. Thanks for reading, --patrick __________________________________ Do you Yahoo!? Check out the new Yahoo! Front Page. www.yahoo.com