Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tqi0f-0007kQ-Ku for pgsql-admin@arkaria.postgresql.org; Thu, 03 Jan 2013 10:26:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Tqi0e-0003XU-KQ for pgsql-admin@arkaria.postgresql.org; Thu, 03 Jan 2013 10:26:48 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tqi0d-0003XO-EE for pgsql-admin@postgresql.org; Thu, 03 Jan 2013 10:26:47 +0000 Received: from mx0.network-studio.com ([62.93.225.99]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tqi0W-0000bg-4w for pgsql-admin@postgresql.org; Thu, 03 Jan 2013 10:26:46 +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 25AD04080D1; Thu, 3 Jan 2013 11:26:38 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zimbra-ne01.network-studio.com (Postfix) with ESMTP id C4831DA1BEA; Thu, 3 Jan 2013 11:26:37 +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 Mf0MUJI++a7o; Thu, 3 Jan 2013 11:26:37 +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 76620DA1534; Thu, 3 Jan 2013 11:26:37 +0100 (CET) Date: Thu, 3 Jan 2013 11:26:37 +0100 (CET) From: Baptiste LHOSTE To: Kevin Grittner Cc: pgsql-admin@postgresql.org, Sylvain CAILLET Message-ID: <1578813003.348817.1357208797415.JavaMail.root@alaloop.com> In-Reply-To: <20121231164107.223680@gmx.com> Subject: Re: Autovacuum issues with truncate and create index ... 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 - GC23 (Linux)/7.2.1_GA_2790) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Hi, > Could you show that output you base that on? EXPLAIN on table which was recently analyzed by the autovacuum process :=20 explain delete from agg_t1343_incoming_a3_src_net_and_dst_net_f5 where star= t_date < 1353317127200; QU= ERY PLAN=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20 ---------------------------------------------------------------------------= -----------------------------------------------------------Index Scan using= agg_t1343_incoming_a3_src_net_and_dst_net_f5_start_date on agg_t1343_incom= ing_a3_src_net_and_dst_net_f5 (cost=3D0.00..9.01 rows=3D41 width=3D6) Index Cond: (start_date < 1353317127200::bigint) (2 rows) Here you can find the duration and the number of deleted rows of previous q= uery. Query duration : 4s 538ms for 15960 rows deleted EXPLAIN on table which was analyzed four days ago by the autovacuum process= :=20 explain delete from agg_t1187_incoming_a6_dst_port_and_proto_f5 where start= _date < 1353317127200; QUERY PLAN=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20 ---------------------------------------------------------------------------= ----------------------- Seq Scan on agg_t1187_incoming_a6_dst_port_and_proto_f5 (cost=3D0.00..580= 63.86 rows=3D3269 width=3D6) Filter: (start_date < 1353317127200::bigint) (2 rows) Here you can find the duration and the number of deleted rows of previous q= uery. Query duration : 52s 368ms for 21130 rows deleted The first EXPLAIN mention that an Index scan is used but the second one men= tion that a sequence scan is used. That why we concluded that we had to have our index up-to-date. > When the bottleneck is disk I/O the CPUs count is not going to > help. Threads which have not been context-switched out, but are > sitting waiting for the electric motors to drag the disk arm to the > right cylinder probably don't count against the load average. My mistake, when I said that the server had a 0.56 load over the last 15 mi= nutes, it was before the change on autovacuum thresholds, because after tha= t the load just blow up.=20 > Note that while three autovacuum processes normally don't cause any > grief, you seem to be near the tipping point anyway, so it may be a > case of "the straw that broke the camel's back". Especially since > you made autovacuum many times more resource-hungry than it is by > default. We tried to change the autovacuum thresholds without changing autovacuum_va= cuum_cost_delay and autovacuum_vacuum_cost_limit. The server managed to handle the work during 25 minutes then it just starte= d to take too much time on CREATE INDEX statements. I just figure that when we perform the full process (with deletion of old d= ata), CREATE INDEX and TUNCATE take too much time. At the same time the autovacuum process seems to perform more tasks on seco= nd type of tables. Best 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 --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin