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...
901Number of tables covered by derived tablesFind the number of base tables, the number of base tables that are referred from at least one derived table (view or materialized view), the number of base tables that are referred from at least one view, and the number of base tables that are referred from at least one materialized view. If the database is used through the public database interface (virtual data layer), then, ideally, each table is referred from the subquery of at least one derived table.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-11-11 09:33MIT License
902Number of underlying tables of derived tablesFind for each view or materialized view the number of tables based on which the derived table has been directly defined. These tables could be base tables or derived tables.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-11-11 09:30MIT License
903Number of used tablesFind statistics about how many derived tables have how many different underlying tables.Sofware measureINFORMATION_SCHEMA+system catalog base tables2024-01-14 13:43MIT License
904Number of using viewsFind statistics about how many base tables have how many derived tables that use these tables.Sofware measureINFORMATION_SCHEMA+system catalog base tables2024-01-14 13:42MIT License
905Number of views with and without security barrierFind the number of views, the number of views with and without security barrier setting, and the names of views with and without the security barrier setting.Sofware measureINFORMATION_SCHEMA+system catalog base tables2024-01-14 12:54MIT License
906Percentage of optional columns in each base tableWhat is the percentage of optional columns (that permit NULLs) in case of each base table? It is better to prohibit the use of NULLs in as many columns as possible. Otherwise the results of queries may be misleading.Sofware measureINFORMATION_SCHEMA only2020-11-08 20:55MIT License
907Percentage of the total index storage size from the total database storage size (system catalog included)Get overview of disk usage.Sofware measuresystem catalog base tables only2020-11-06 14:51MIT License
908Referential degree of a schemaReferential degree of a schema is defined as the number of foreign keys in the database schema.Sofware measureINFORMATION_SCHEMA only2020-11-13 11:30MIT License
909Referential degree of tablesThis metric represents the number of foreign keys in a base table.Sofware measureINFORMATION_SCHEMA only2021-03-12 11:07MIT License
910Referential degree of tables (ver 2)Find how many base tables are referenced from a base table by using foreign keys.Sofware measuresystem catalog base tables only2021-03-12 11:06MIT License
911The generic names (columns) (aggregate view)(2)Find the number of too generic base table and view column names. Do not differentiate between base table and view columns to determine what name is generic.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-01-18 16:42MIT License
912The longest 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 TOP 3 longest (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.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-03-17 01:09MIT License
913The longest referential pathsFind the longest referential paths between the tables regardless of the schema that contain the tables.Sofware measuresystem catalog base tables only2020-11-14 15:42MIT License
914The number and percentage of base tables where all the non-primary key columns are optionalFind the number and percentage of base tables where all the non-primary key columns are optionalSofware measureINFORMATION_SCHEMA only2020-11-08 19:57MIT License
915The number and percentage of base tables without CHECK constraintsFind the extent in which data integrity is checked at the database level. Find the number and percentage of base tables that do not have any associated CHECK constraints.Sofware measureINFORMATION_SCHEMA only2020-11-08 19:15MIT License
916The number and percentage of base tables without keysFind the extent in which repeating rows are permitted in the database. Find the number and percentage (from the total number of base tables) of base tables that do not have the PRIMARY KEY constraint and also do not have any UNIQUE constraints.Sofware measureINFORMATION_SCHEMA only2020-11-08 19:16MIT License
917The number and percentage of different names of database objectsNames should be expressive. Find the number of different names used in a database as well as the number of named database objects, and the percentage of different names from all the names. Names should be expressive. Different objects should have different names. The smaller the percentage the less descriptive are the names in the database. Find the number of different names (identifiers) of user-defined database objects and compare it with the total number of database objects. The values could be used to compare different databases.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-03-18 17:12MIT License
918The number and percentage of different 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. Different objects should have different names. The smaller the percentage the less descriptive are the names in the database. Find the number of different names (identifiers) of user-defined database objects by the object type and compare it with the total number of database objects with this type. The values could be used to compare different databases.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-03-16 15:38MIT License
919The number and percentage of optinal columns in base tablesFind the number and percentage of optinal columns in base tablesSofware measureINFORMATION_SCHEMA only2020-11-08 21:17MIT License
920The number of base table columns based on data typeFind the number of base table columns based on data type.Sofware measureINFORMATION_SCHEMA only2020-11-19 15:30MIT License