Is there a way to correct an inaccurate n_distinct value for extended statistics in PG11?

From: Hotmail <crajac66(at)hotmail(dot)com>
To: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Is there a way to correct an inaccurate n_distinct value for extended statistics in PG11?
Date: 2020-10-09 16:35:03
Message-ID: BYAPR06MB40235AC790D12757F765CDBFD7080@BYAPR06MB4023.namprd06.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi All,

We have created extended statistics between two columns on a large table. When looking at pg_statistic_ext the value for n_distinct for the combined columns is off of the actual number of distinct values  by approixmately 40%. This is leading to a poor choice of leading tables in some of our joins.

With single column statistics inaccurate n_distinct values can be corrected with "alter table alter column set n_distinct ="

Is there a way to fix incorrect n_distinct values for extended statisitics?

Thanks,

Craig Jackson

Browse pgsql-admin by date

  From Date Subject
Next Message Massimo Ortensi 2020-10-11 11:26:17 Re: Dropping database in replica
Previous Message Laurenz Albe 2020-10-09 15:06:00 Re: terminating connection due to conflict with recovery