Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 0A82A632886 for ; Fri, 9 Apr 2010 04:37:39 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 41228-06 for ; Fri, 9 Apr 2010 07:37:24 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from rs47.luxsci.com (rs47.luxsci.com [65.61.166.88]) by mail.postgresql.org (Postfix) with ESMTP id 5DB51632333 for ; Fri, 9 Apr 2010 04:37:28 -0300 (ADT) Received: from gnanam (ABTS-TN-Static-186.58.165.122.airtelbroadband.in [122.165.58.186] (may be forged)) (authenticated bits=0) by rs47.luxsci.com (8.13.1/8.13.7) with ESMTP id o397bKr2004840; Fri, 9 Apr 2010 02:37:23 -0500 Reply-To: From: "Gnanakumar" To: "'Alvaro Herrera'" Cc: References: <00c001cad728$22f92f20$68eb8d60$@com> <20100408145328.GB4126@alvh.no-ip.org> In-Reply-To: <20100408145328.GB4126@alvh.no-ip.org> Subject: Re: Autovacuum daemon functionality questions Date: Fri, 9 Apr 2010 13:07:20 +0530 Organization: Zoniac Software Private Limited Message-ID: <001701cad7b7$7f1e2730$7d5a7590$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcrXK0JWOVizLxLlTRWvcf6wlI8oRQAiiJrw Content-Language: en-us X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.235 tagged_above=-10 required=5 tests=AWL=-0.527, MAY_BE_FORGED=0.292 X-Spam-Level: X-Archive-Number: 201004/102 X-Sequence-Number: 34196 >> 1. Why need to have 2 parameters (base threshold and scale factor) to define >> the threshold value, when either one of the parameter is more than enough to >> define the threshold value. Can you explain the significance of having both >> parameters. What is the real-time advantage of this? >real-time advantage? They are just the two factors in a linear >equation. >> 2. Documentation says ".... If the number of obsolete tuples since the last >> VACUUM exceeds the "vacuum threshold", the table is vacuumed ...". >> I also know about this table "pg_stat_user_tables" which has columns >> n_tup_ins, n_tup_upd, n_tup_del, last_autovaccum and last_autoanalyze. >> Since INSERT, UPDATE and DELETE count gets incremented everytime and do not >> reset after running autovacuum/autoanalyze, how does autovacuum identifies >> obsolete tuples since last VACUUM from this entries. >There are two separate counters for live and dead tuples, IIRC (though >they may not be exposed in the pg_stat views) I've a stop/start of PostgreSQL service on a daily basis. Since these 2 counters are not stored/saved in tables and not available in pg_stat views also, will these values be persisted/retained even after stop/start/restart? >There are two separate counters for live and dead tuples As per documentation, live tuples can always be obtained from pg_class.reltuples. So, the question/answer here again would be to have only counter on dead tuples since last VACUUM. Is my understanding right? Is there some other/alternative way where I can check obsolete tuples at any time since last VACUUM? >> 3. Is there a way to see autovacuum daemon log entries? >Not in 8.2.