From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: henri.chapelle@dbandmore.com
Subject: BUG #17942: vacuumdb doesn't populate extended statistics on partitioned tables
Date: Wed, 24 May 2023 06:41:23 +0000
Message-ID: <17942-50aa28accc2e412c@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 17942
Logged by: Henri Chapelle
Email address: henri.chapelle@dbandmore.com
PostgreSQL version: 13.8
Operating system: Centos 7
Description:
Hi,
We recently added extended statistics on big partitioned tables in
Postgresql 13.8.
While runing analyze tablename or vacuumdb -Z -t tablename populate extended
statistics, the vacuumdb -Z command (without -t) doesn't process the parent
table during the analyze.
We created a script to collecte table names and run the analyze table by
table.
Is it expected ?
The documentation mentions that autovacuum will not process the parent table
due to no data in the parent table.
But vacuumdb should process all tables, right ?
Here is an example :
CREATE TABLE people (
id int not null,
birth_date date not null,
country_code character(2) not null,
name text
) PARTITION BY RANGE (birth_date);
CREATE TABLE people_y2000 PARTITION OF people
FOR VALUES FROM ('2000-01-01') TO ('2001-01-01');
CREATE TABLE people_y2001 PARTITION OF people
FOR VALUES FROM ('2001-01-01') TO ('2002-01-01');
CREATE TABLE people_y2002 PARTITION OF people
FOR VALUES FROM ('2002-01-01') TO ('2003-01-01');
INSERT INTO people (id, birth_date, country_code, name) VALUES (1,
'2000-01-01', 'US', 'John'), (2, '2000-02-02', 'IT', 'Jane'), (3,
'2001-03-03', 'FR', 'Bob');
create statistics people_stat_001 on birth_date, name from people;
vacuumdb -Z -t people : -> ok extende stats collected
vacuumdb -Z : -> no extended stats and analyze much faster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, henri.chapelle@dbandmore.com
Subject: Re: BUG #17942: vacuumdb doesn't populate extended statistics on partitioned tables
In-Reply-To: <17942-50aa28accc2e412c@postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox