Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TTZr5-0003Lk-Co for pgsql-admin@postgresql.org; Wed, 31 Oct 2012 15:05:19 +0000 Received: from mx0.network-studio.com ([62.93.225.99]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TTZr1-0007pp-Kl for pgsql-admin@postgresql.org; Wed, 31 Oct 2012 15:05:18 +0000 Received: from zimbra-ne01.network-studio.com (zimbra-admin.network-studio.com [192.168.101.80]) by mx0.network-studio.com (Postfix) with ESMTP id E9C564080AD for ; Wed, 31 Oct 2012 16:05:13 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zimbra-ne01.network-studio.com (Postfix) with ESMTP id E708DDA1C25 for ; Wed, 31 Oct 2012 16:05:13 +0100 (CET) X-Virus-Scanned: amavisd-new at zimbra-ne01.network-studio.com Received: from zimbra-ne01.network-studio.com ([127.0.0.1]) by localhost (zimbra-ne01.network-studio.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ed3uPi1MFgMx; Wed, 31 Oct 2012 16:05:13 +0100 (CET) Received: from zimbra-ne01.network-studio.com (zimbra-ne01.network-studio.com [192.168.101.80]) by zimbra-ne01.network-studio.com (Postfix) with ESMTP id 82FC8DA1BED; Wed, 31 Oct 2012 16:05:13 +0100 (CET) Date: Wed, 31 Oct 2012 16:05:13 +0100 (CET) From: Baptiste LHOSTE To: pgsql-admin@postgresql.org Cc: Sylvain CAILLET Message-ID: <626919622.7634700.1351695913466.JavaMail.root@alaloop.com> In-Reply-To: <1442070268.7614953.1351693260184.JavaMail.root@alaloop.com> Subject: Autoanalyze of the autovacuum daemon ... MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [192.168.101.82] X-Mailer: Zimbra 7.2.1_GA_2790 (ZimbraWebClient - GC22 (Linux)/7.2.1_GA_2790) X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201210/129 X-Sequence-Number: 40245 Hi All,=20 We are using postgreSQL since 2007 (now we use postgreSQL 8.4) and until re= cently we used to perform deletion of old data then vacuum and analyze task= s by ourself (every night at 0am CET). Nevertheless we reached a point where these tasks are taking so much time t= hat why we decide to perform deletion of old data every hour and let the au= tovacuum daemon manage vacuum and analyze tasks. But we have some difficulties to understand how work the trigger of the aut= ovacuum daemon for autoanalyze tasks.=20 Let me explain our database structure. We have two kind of tables :=20 - first one on which we perform a complete truncate and a copy to fill each= (partitioned tables - 288 partitions, one per 5mn re-used every day)=20 - second one on which we insert some new data every five minutes (avg~200 r= ows) and delete old data about every 1 hour (avg~1000 rows).=20 For complete understanding, we need up-to-date stats for the second one bec= ause the recurrent deletion might take a long time, (~1mn for less than 100= 0 deleted rows because planer uses seq scan instead of index scan).=20 The autovacuum perform autoanalyze tasks on first kind as soon as the proce= ss (truncate + copy) is done.=20 But the autoanalyze is not that effective for second kind. We tried to reduce autovacuum_analyze_threshold (50 =3D> 10) and autovacuum= _analyze_scale_factor (0.1 =3D> 0.005) for the second kind of tables (ALTER= TABLE ... SET PARAMETERS ...) without any conclusive effect.=20 We can not find where is stored the total number of tuples inserted or upda= ted since the last ANALYZE. Could someone give us the answer ? We take a look at the relfrozenxid but our tables do not have a big value o= f relfrozenxid (< 10000000).=20 Most of the time there is no autovacuum analyze query in the pg_stat_activi= ty, althought we set the autovacuum_naptime to 15s to try to start new anal= yze task more often. We do not understand why we can't obtain some improvments with previous cha= nges. Did we do something wrong ?=20 Thank you all for your kind advices,=20 Regards, Baptiste. ---=20 Baptiste LHOSTE=20 blhoste@alaloop.com=20 ALALOOP S.A.S. - Technopole Izarbel - 64210 Bidart=20 T=C3=A9l=C3=A9phone : +33 (0) 5 59 41 51 10=20 www.alaloop.com=20