Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T27Ku-0005X5-W3 for pgsql-performance@postgresql.org; Thu, 16 Aug 2012 21:10:37 +0000 Received: from mail-gg0-f174.google.com ([209.85.161.174]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T27Ks-0006rn-1G for pgsql-performance@postgresql.org; Thu, 16 Aug 2012 21:10:36 +0000 Received: by ggdk6 with SMTP id k6so3428073ggd.19 for ; Thu, 16 Aug 2012 14:10:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:references:in-reply-to:subject:date:message-id:mime-version :content-type:content-transfer-encoding:x-mailer:thread-index :content-language:x-gm-message-state; bh=pzOlOeq8Wgfmldf/JJG1ZbjX6T63w+xJPQhqeSovNlc=; b=SznPSS3IeKDCO4VnfR0O8+QxNZ6Yo2AvE+YvTFRkIx9gFNCBCirDtCOchgn46MRs9y 3OeIScTMczgalgbo/JiKVklQKGyP+PNAnkeIRlaf+5gZfrrt6z4qTCgZabLmgWqUiRLJ 6D8g5JwovTsqiYe51OtIRsEDNYLs68w+PPbv5iEkNNx7Yrul/HvXPDByNQ00M7nR5F/F CppaQoCaoWJbx8Sg5MUawGr5r7ukjFUgKp2G78AcsndTWL+QTEIt1m2g/c4SvV/p6V4p UJq+yYhgwn65DWnnwXArC6dzaePlEIuBF934ukq8oagXBMh/3ylpHCxuhwSR8K7ZZcwq 81RQ== Received: by 10.101.60.16 with SMTP id n16mr1128638ank.16.1345151432997; Thu, 16 Aug 2012 14:10:32 -0700 (PDT) Received: from AnibalVAIO ([190.128.222.90]) by mx.google.com with ESMTPS id c64sm10361215yhj.17.2012.08.16.14.10.31 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 16 Aug 2012 14:10:32 -0700 (PDT) From: "Anibal David Acosta" To: "'Kevin Grittner'" , References: <009d01cd7bee$785b1380$69113a80$@devshock.com> <502D173702000025000497D1@gw.wicourts.gov> In-Reply-To: <502D173702000025000497D1@gw.wicourts.gov> Subject: Re: best practice to avoid table bloat? Date: Thu, 16 Aug 2012 17:10:31 -0400 Message-ID: <00c201cd7bf3$93bc4130$bb34c390$@devshock.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQK7QPGWhO6yMB3u2/1Hg2+iMZ7ltwHSQBc1lXLPf8A= Content-Language: es-py X-Gm-Message-State: ALoCoQm7QyLavJRsvsni6m0wELRRP79ZX9EQ/73NdrS/3LxpQjo9g3mDs4U+POrNuDx+rVcyUBZR X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201208/115 X-Sequence-Number: 47653 Thanks Kevin. Postgres version is 9.1.4 (lastest) Every day the table has about 7 millions of new rows. The table hold the data for 60 days, so approx. the total rows must be around 420 millions. Every night a delete process run, and remove rows older than 60 days. So, the space used by postgres should not be increase drastically because every day arrive 7 millions of rows but also same quantity is deleted but my disk get out of space every 4 months. I must copy tables outside the server, delete local table and create it again, after this process I got again space for about 4 months. Maybe is a wrong autovacuum config, but is really complicate to understand what values are correct to avoid performance penalty but to keep table in good fit. I think that autovacuum configuration should have some like "auto-config" that recalculate every day which is the best configuration for the server condition Thanks! -----Mensaje original----- De: Kevin Grittner [mailto:Kevin.Grittner@wicourts.gov] Enviado el: jueves, 16 de agosto de 2012 04:52 p.m. Para: Anibal David Acosta; pgsql-performance@postgresql.org Asunto: Re: [PERFORM] best practice to avoid table bloat? "Anibal David Acosta" wrote: > if I have a table that daily at night is deleted about 8 millions of > rows (table maybe has 9 millions) is recommended to do a vacuum > analyze after delete completes or can I leave this job to autovacuum? Deleting a high percentage of the rows should cause autovacuum to deal with the table the next time it wakes up, so an explicit VACUUM ANALYZE shouldn't be needed. > For some reason for the same amount of data every day postgres consume > a little more. How are you measuring the data and how are you measuring the space? And what version of PostgreSQL is this? -Kevin