Catalog of PostgreSQL queries for finding information about a PostgreSQL database and its design problems

AND
AND
ANDQueries of this category provide information about indexes in a database.
ANDFrom where does the query gets its information?
AND
AND

There are 79 queries.

Seq nrNameGoalTypeData sourceLast updateLicense...
1All clustered indexesFind all tables that rows have been physically sorted based on an index.Generalsystem catalog base tables only2022-10-31 10:17MIT License
2All covering indexesFind all covering indexes, which include data from additional columns in leaf blocks.GeneralINFORMATION_SCHEMA+system catalog base tables2020-12-23 11:54MIT License
3All declaratively partitioned tablesFind partitioned tables that have been implemented by using the declarative approach. Declarative partitioning is implemented in PostgreSQL starting from PostgreSQL 10.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 15:13MIT License
4All gin indexesFind indexes with less common access methods. Gin indexes are, for instance, used to speed up PostgreSQL's built in full text search.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
5All non-unique indexesFind secondary indexes that have been created in the database.GeneralINFORMATION_SCHEMA+system catalog base tables2020-12-23 11:50MIT License
6All partial indexesFind indexes to a subset of table rows.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
7Base table FILLFACTOR is not 100Find all base tables where FILLFACTOR is not 100, i.e., the default value.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
8Base tables and materialized views without any indexFind base tables and materialized views that do not have any index.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-05 19:39MIT License
9Base tables that have more than five indexesFind base tables that have more than five indexes. Indexes can be used to increase the speed of queries (SELECT statements). However, the amount of indexes shouldn't be too large. Otherwise it may reduce the speed of operations that are used to modify data.Problem detectionsystem catalog base tables only2022-10-21 10:33MIT License
10Base tables that have no uniqueness requirement for rows whatsoeverFind base tables without any unique constraints and primary key as well as any unique index, whether it is created explicitly by a developer or automatically by the DBMS. The only legitimate reason of such a table is if it is an abstract table that is used to define common columns of subtables.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-10-21 10:16MIT License
11Base tables where uniqueness is achieved by using only unique indexesFind base tables where uniqueness is achieved by using only unique indexes, i.e., there is at least one unique index but no uniqueness constraints (PRIMARY KEY, UNIQUE, EXCLUDE)Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-10-21 01:54MIT License
12Base tables, which statistics is probably not up to dateFind base tables where statistics has not been collected at all or it has been lastly collected more than 40 days ago.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
13B-tree index fillfactor has been explicitly set to 90Find B-tree indexes that fillfactor has been explicitly set to 90. In case of B-tree indexes the default is 90.Problem detectionsystem catalog base tables only2024-12-11 14:37MIT License
14Case sensitive and case insensitive uniqueness of the same simple keyFind sets of columns that have both case sensitive and case insesitive unique constraints enforced based on these columns. In case of textual columns uniqueness could be checked either in case sensitive or case insensitive way. It is a contradiction to check the uniqueneness in both ways in case of the same key.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
15Columns with exact/floating numeric types have textual default valuesThe default value of a column should belong to the type of the column. The system shouldn't conduct unnecessary type casts.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
16Constraint-supporting UNIQUE indexes with the same leading columnFind indexes that support a uniqueness constraint and have the same leading column.Generalsystem catalog base tables only2023-11-26 16:01MIT License
17Declaratively partitioned tables with one partitionFind declaratively partitioned tables that have exactly one partition. Declarative partitioning is implemented in PostgreSQL starting from PostgreSQL 10. If there is only one partition, then it raises question as to why the additional complexity associated with partitioning is needed.Problem detectionINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
18Declaratively partitioned tables without partitionsFind declaratively partitioned tables that do not have any partitions. Declarative partitioning is implemented in PostgreSQL starting from PostgreSQL 10.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
19Definition of a non-minimal superkey instead of a candidate key (based on unique indexes)Find pairs of non-partial unique indexes where the columns of a index are a proper subset of the columns of another index. Include indexes that support a constraint (primary key, unique, exclude), i.e., these indexes have been automatically created due to the constraint declaration. Exclude the pairs where both participants have been created to support a constraint. Candidate key is a minimal superkey, meaning that it is not possible to remove columns from the candidate key without losing its uniqueness property. One should define keys based on candidate keys, i.e., the keys should not have redundancy in terms of columns. Defining a unique index essentially means defining a key in the table but it is done at the lower level of abstraction.Problem detectionsystem catalog base tables only2022-10-21 15:56MIT License
20Derived table uses a function to get data from another tableFind views that use a function to get data from another table.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-24 14:36MIT License