Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ty1VF-0007oL-VG for pgsql-admin@arkaria.postgresql.org; Wed, 23 Jan 2013 14:40:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Ty1VF-0004l1-5s for pgsql-admin@arkaria.postgresql.org; Wed, 23 Jan 2013 14:40:37 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ty1VD-0004kv-Um for pgsql-admin@postgresql.org; Wed, 23 Jan 2013 14:40:36 +0000 Received: from mail-pb0-f49.google.com ([209.85.160.49]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ty1VC-0002CX-1p for pgsql-admin@postgresql.org; Wed, 23 Jan 2013 14:40:34 +0000 Received: by mail-pb0-f49.google.com with SMTP id un15so4695168pbc.22 for ; Wed, 23 Jan 2013 06:40:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=IqyXTdZOfkwc6IKefpWyLvSRImQLIv23brAUPPRiUGQ=; b=w+hrWf8pXp4hL5d03Wo6u2LDYmc9Z8BICOxq/kDVqugPei9NGFn6/XHHrdFmf3AM6Q j0SCIxnvqirPaeb6DqVnFUipzrYmQYiEAlm//X7izh1YGGD6drJWkcul+j3NkYcfDwtZ w13rRJqfuQu+Yqok/FzTARbd9a3VGrlCskazsBIt/UOBUFM/34TbWI31jquFFUObz3D0 LbQx+9iW/xiJIEVHuNYlzmaABLOqEopqPeDDMCTgaENxiRXqI2/U8opntQGJDT+wvWM4 VEK5AKvH3iK45CY7NXLl1gw83qk2ruxTUrYcqCEjahruZ8vqPMHjCzuTtHn86A9huGEf PS+Q== X-Received: by 10.68.197.9 with SMTP id iq9mr3970676pbc.130.1358952032268; Wed, 23 Jan 2013 06:40:32 -0800 (PST) Received: from [192.168.11.4] ([114.95.132.19]) by mx.google.com with ESMTPS id ay6sm13667275pab.30.2013.01.23.06.40.28 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Jan 2013 06:40:31 -0800 (PST) Message-ID: <50FFF659.6070003@gmail.com> Date: Wed, 23 Jan 2013 22:40:25 +0800 From: Rural Hunter User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Re: vacuum / analyze parent tables on partitioned tables. References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.6 (--) 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 I'm doing the same thing. In my case, the vacuum part on parent is very quick while analyzing takes a bit longer since it runs rough analyzes all children tables. You can see the behavior by "analyze verbose". Maybe the bigger part of your vacuum/analyze is on analyze so that you are seeing this result. 于 2013/1/23 19:43, Bert 写道: > Hello, > > I first wrote, by mistake, to the sql mailing list. But here is my > e-mail: > > I wrote a script to make sure all tables are vacuumed and analyzed > every evening. This works very well. > I save in a table the start and end time of a vacuum/analyze. This way > I can measure what tables take a long time to vaccum/analyze, and what > tables are slow. (and much more). > > But I have noticed that the parent table of a partitioned table also > takes a long time. Here is a snap shot of the following table > > table_name ; avg runt time ; max run time ; min > run time > "f_transaction_1" ; "00:03:07.8" ; "00:03:10" ; "00:03:03" > "f_transaction" ; "00:02:19.8" ; "00:02:25" ; "00:02:16" > > f_tranaction_1 is 16GB data + 12GB of indexes. (I know, a lot of > indexes). f_tranaction is totally empy, but also contains all indexes. > Which means 0B table zise, and 140kB index size. > > Does anyone has an idea why in this case the vacuum/analyze takes > almost as long on the parent table as on the biggest child table? (the > other child tables are smaller than f_tranaction_1, and their > vacuum/analyze time is much shorter). > > wkr, > Bert -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin