From: | Ilia Evdokimov <ilya(dot)evdokimov(at)tantorlabs(dot)com> |
---|---|
To: | pgsql-admin(at)lists(dot)postgresql(dot)org |
Subject: | Duplicate Extended Statistics |
Date: | 2024-09-03 13:09:50 |
Message-ID: | 0251f755-00bb-41c7-8f76-14a3604f6d18@tantorlabs.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
Hello everyone,
I have a question regarding extended statistics in PostgreSQL. Why is it
possible to create duplicate extended statistics? To make it clearer,
here’s an example:
CREATE TABLE t(a int, b int);
INSERT INTO t(a, b) VALUES (...);
CREATE STATISTICS ON a, b FROM t;
ANALYZE t;
....
CREATE STATISTICS ON a, b FROM t;
ANALYZE t;
After executing these queries, the following issues might arise:
1. ANALYZE will take longer to run because, for example, MCV extended
statistics would need to be gathered twice.
2. Duplicate information will be stored.
3. The planner might take longer to find the relevant statistics since
it has to search through them in a loop.
Or do duplicate extended statistics practically never occur in practice?
Thanks in advance for your response.
--
Regards,
Ilia Evdokimov,
Tantor Labs LCC.
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2024-09-03 14:11:59 | Re: Duplicate Extended Statistics |
Previous Message | Kashif Zeeshan | 2024-09-03 12:37:02 | Re: Basebackup |