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

AND
AND
AND
ANDFrom where does the query gets its information?
AND
AND

There are 961 queries.

Seq nrNameGoalTypeData sourceLast updateLicense...
841The same sequence generator is used in case of multiple columnsDo not cause a potential performance bottleneck by having a shared resource. By having a shared sequence it is not possible to change properties of sequences of different tables independently (for instance the owner column or step), i.e., it increases coupling between tables. By having a shared sequence it is impossible to specify the owner (table column) to the sequence generator.Problem detectionINFORMATION_SCHEMA only2021-03-07 21:07MIT License
842The same trigger function is used in case of multiple tablesFind trigger functions that are used in case of more than one table. Although it is legal, one must be careful when changing the functions in order to avoid unwanted consequences.GeneralINFORMATION_SCHEMA only2020-12-25 14:50MIT License
843The shortest names of database objects by object type"Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should be expressive. Find the shortest (identifiers) names of user-defined objects by their type. These could be the first candidates of renaming in order to give to database objects better names.GeneralINFORMATION_SCHEMA+system catalog base tables2023-03-18 16:54MIT License
844The size of base tables and their indexesFind the size of base tables without indexes, size of the indexes of the table, total size of the table (including its indexes) and percentage of the index size from the total size. If the size of indexes of a table is relatively high, then check as to whether all the indexes are needed.Generalsystem catalog base tables only2023-10-27 20:38MIT License
845The SQL-language routines with the body that is string literalFind SQL-language routines that have the body that is string literal, i.e., the body is not SQL-standard function body. Routines with a SQL-standard body are permitted starting from PostgreSQL 14.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-01-24 18:20MIT License
846The storage size of each index (the system catalog excluded)Get overview of disk usage.Sofware measuresystem catalog base tables only2020-11-06 14:51MIT License
847The storage size of each schema data object (the system catalog excluded)Get overview of disk usage by different schema objects that contain user data.Sofware measuresystem catalog base tables only2020-11-06 14:51MIT License
848The storage size of each table (including indexes) (the system catalog excluded)Get overview of disk usage.Sofware measuresystem catalog base tables only2020-11-06 14:51MIT License
849The total number of physical lines of code in the bodies of user-defined SQL and PL/pgSQL functions/proceduresFind a numerical measure that describes the extent of the database public interface (virtual data layer) through which users access the database.Sofware measureINFORMATION_SCHEMA+system catalog base tables2021-11-04 21:02MIT License
850The total size of all indexes (system catalog excluded)Sofware measuresystem catalog base tables only2023-05-14 11:04MIT License
851The total size of all tables (system catalog excluded)Sofware measuresystem catalog base tables only2023-05-14 11:04MIT License
852The total storage size of all indexes (the system catalog excluded)Get overview of disk usage.Sofware measuresystem catalog base tables only2020-11-06 14:51MIT License
853The total storage size of the database (the system catalog included)Get overview of disk usage.Sofware measuresystem catalog base tables only2020-11-06 14:51MIT License
854The usage of data type formatting functionsFind expressions that use a data type formatting function - to_char, to_number, to_date, to_timestamp.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
855The usage of double vs singular underscores or spaces in names as separator of name componentsImprove the readability of names. Find the number of names (identifiers) of user-defined database objects that contain two or more consecutive underscores or spaces as the separator of name components vs. the number of names that contain a single underscore or space to separate name components. Try to be consistent in the usage of underscores.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-03-17 11:11MIT License
856The use of xmin hidden column in views and routinesFind the number of views and materialized views that have a column with the xid type and the number of routines that contain a UPDATE or a DELETE statement that search condition refers to the xmin column. If one uses optimistic approach for dealing with the concurrent modifications of data, then xmin values should be presented by views and used in routines that modify or delete rows.Sofware measureINFORMATION_SCHEMA+system catalog base tables2021-11-04 11:56MIT License
857Three-valued logic (Boolean columns)Find base table columns that have Boolean type and do not have NOT NULL constraint. Use two-valued logic (TRUE, FALSE) instead of three-valued logic (TRUE, FALSE, UNKNOWN). Because NULL in a Boolean column means unknown make all the Boolean columns mandatory.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
858Three-valued logic (non-Boolean columns)Find non-foreign key columns of base tables that probably (based on the column name) contain values that represent truth values but do not have NOT NULL constraint. Use two-valued logic (TRUE, FALSE) instead of three-valued logic (TRUE, FALSE, UNKNOWN). Because NULL in a Boolean column means unknown make all the columns mandatory.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-03-20 14:07MIT License
859Too few rounds in case of calculating the hashFind user-defined routines where gen_salt function is used with the number of rounds that is smaller than 12. The number should be adjusted based on the hardware where the system resides. Password hashing should take at least 250 ms.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-10-25 17:21MIT License
860Too generic names (candidate key columns)Find candidate key columns with the names like id, identifikaator, code, kood, number, etc. The names should have a prefix or a suffix. These are too generic names.Problem detectionsystem catalog base tables only2023-01-20 12:35MIT License