vacuum / analyze parent tables on partitioned tables.

From: Bert <biertie(at)gmail(dot)com>
To: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: vacuum / analyze parent tables on partitioned tables.
Date: 2013-01-23 10:21:59
Message-ID: CAFCtE1n_mwfBDKhDDQucqKJV2hYffdhytuWC-=AHk6ouO5c1Ww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello,

I wrote a script to make sure all tables are vacuumed and analyzed every
evening. This works very well, but I have a question:
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 15GB 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, and their vacuum/analyze time is much shorter).

wkr,
Bert

--
Bert Desmet
0477/305361

Browse pgsql-sql by date

  From Date Subject
Next Message Matthias Nagel 2013-01-23 10:28:10 Range types (DATERANGE, TSTZRANGE) in a foreign key with "inclusion" logic
Previous Message Alexander Gataric 2013-01-23 01:37:55 Re: [SQL] need some magic with generate_series()