X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id E3BC5D1E6A7 for ; Mon, 10 May 2004 11:24:39 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 41256-04 for ; Mon, 10 May 2004 11:24:23 -0300 (ADT) Received: from vscan02.westnet.com.au (vscan02.westnet.com.au [203.10.1.132]) by svr1.postgresql.org (Postfix) with ESMTP id 21891D1E60E for ; Mon, 10 May 2004 11:24:19 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by localhost (Postfix) with ESMTP id 153F5101408; Mon, 10 May 2004 22:24:21 +0800 (WST) Received: from [192.168.1.9] (dsl-202-72-133-22.wa.westnet.com.au [202.72.133.22]) by vscan02.westnet.com.au (Postfix) with ESMTP id 9C2F010112F; Mon, 10 May 2004 22:24:20 +0800 (WST) Message-ID: <409F9098.20700@familyhealth.com.au> Date: Mon, 10 May 2004 22:24:24 +0800 From: Christopher Kings-Lynne User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Anderson Boechat Lopes Cc: pgsql-performance@postgresql.org Subject: Re: Why queries takes too much time to execute? References: <00b901c43697$333ec5d0$5f00a8c0@suport01> In-Reply-To: <00b901c43697$333ec5d0$5f00a8c0@suport01> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200405/58 X-Sequence-Number: 6889 > Well, i have a very large database, with vary tables and very > registers. Every day, too many operations are perfomed in that DB, with > queries that insert, delete and update. Once a week some statistics are > collected using vacuum analyze. Have vacuum analyze running once an HOUR if it's very busy. If you are using 7.4, run the pg_autovacuum daemon that's in contrib/pg_autovacuum. > The problem is after a period of time (one month, i think), the > queries takes too much time to perform. A simple update can take 10 > seconds or more to perform. If running vacuum analyze once an hour doesn't help, try running a vacuum full once a week or something to fix the problem. Also, try upgrading to 7.4 which has indexes that won't suffer from bloat. Chris