Re: Duplicate Extended Statistics

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 04.09.24 um 10:28 schrieb Asad Ali:
Hi Ilia,

In PostgreSQL, it is possible to create duplicate extended statistics because the system does not enforce uniqueness on statistics definitions. However, this is generally not recommended, as it leads to longer ANALYZE times, increased storage usage, potential planner performance impact, and unnecessary complexity. In practice, duplicates are rare because users and tools usually avoid redundancy, as there is no added benefit to having multiple identical sets of statistics on the same columns.

Regards,
Asad Ali


To find duplicate indexes:

SELECT  indrelid::regclass::text AS "Table Name",
        string_agg(indexrelid::regclass::text ||
          CASE WHEN indisunique
          THEN ' (UNIQUE)' ELSE ''
          END, ', ') AS "Indexes"
      FROM pg_index
      GROUP BY indrelid, indkey
      HAVING COUNT(*) > 1

--

Holger Jakobs, Bergisch Gladbach

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


[Index of Archives]     [Postgresql Home]     [Postgresql General]     [Postgresql Performance]     [Postgresql PHP]     [Postgresql Jobs]     [PHP Users]     [PHP Databases]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Forum]

  Powered by Linux