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...
701Different data types that are used to define base table columnsFind the number of different data types that are used to define base table columns as well as list all the different types. Data type constrains values in a column. Thus, in case there is a small number of used types, it raises a question as to whether the types have been optimally selected.Sofware measureINFORMATION_SCHEMA only2020-11-27 10:40MIT License
702The number of schema objects by schema, by type, and in totalFind the number of different types of schema objects in different schemas as well as the total number of schema objects. Show the number of objects that belong to an extension as well as the number of (user-defined) objects that do not belong to an extension.Sofware measuresystem catalog base tables only2020-11-06 14:51MIT License
703The number of direct and indirect child tables (foreign keys)Find the number of direct and all (direct+indirect) child tables of a base table based on the foreign keys. The result may help to classify the data. If the number of direct children is small but the number of all children is large, then the table probably contains classifiers. If both the number of direct and all children is large, then the table probably contains master data. If the number of all children is small, then the table probably contains transactional data, logs, or descriptive information of main entities.Sofware measuresystem catalog base tables only2020-11-14 16:10MIT License
704The number of direct and indirect child tables (table inheritance)Find the number of direct and all (direct+indirect) child tables of a base table based on the table inheritance.Sofware measuresystem catalog base tables only2020-11-14 19:59MIT License
705Consistency of using NOT NULL constraints on Boolean base table columnsFind the number of mandatory and optional Boolean base table columns and the proportion of optional columns from all the Boolean columns. 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.Sofware measureINFORMATION_SCHEMA only2020-12-28 01:43MIT License
706Names of database objects that perhaps end with a sequence number (aggregate view)Find the number of names (identifiers) of user-defined database objects that end with one or more digit. Names should be informative. Duplicates should be avoided. Digits in names are a possible sign of duplication of database objects or unclear names.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-11-12 10:06MIT License
707The number of names that use different writing stylesFind the number of names of user-defined database objects that use snake_case, ALL CAPS, Sentence case, camelCase or PascalCase style. Make sure that the naming style is consistent.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-03-18 16:44MIT License
708Inconsistent use of gratuitous context in the names of non-foreign key and non-candidate key columnsFind the number of names on base table columns that are not a part of a candidate key and a foreign key and that contain the name of the table. Find the number of names on base table columns that are not a part of a candidate key and a foreign key and that do not contain the name of the table. Make sure that table name is used consistently in the column names.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-10-26 20:25MIT License
709The number of user-defined routines based on their database usageFind the number of non-extension routines in a database that modify data. The routines can be used to implement virtual data layer. Thus the queriy gives some indications about the possible extent of the layer. The query distinguishes trigger and non-trigger routines, thus it also gives information about triggers that modify data.Sofware measureINFORMATION_SCHEMA+system catalog base tables2024-01-15 00:38MIT License
710Number of rows in base tablesFind the number of rows in base tables.Generalsystem catalog base tables only2022-10-27 19:44MIT License
711The number of rules by different characteristicsFind the number of rules by event (SELECT, INSERT, UPDATE, and DELETE) and in total.Sofware measuresystem catalog base tables only2024-01-14 16:10MIT License
712The number of user-defined rulesFind the number of rules in a database, excluding the rules that are associated with system catalog tables and rules that are created to support views. Rules can be used to maintain data integrity in a database by causing rejection of incorrect insertions and updates. Therefore, the number of rules in a database gives some indications about the state of enforcing constraints at the database level.Sofware measuresystem catalog base tables only2022-10-21 11:19MIT License
713The number of user-defined rules by schema and in totalFind the number of rules in a database in different schemas, excluding the rules that are created to support views. Rules can be used to maintain data integrity in a database by causing rejection of incorrect insertions and updates. Therefore, the number of rules in a database gives an indication about the state of enforcing constraints at the database level.Sofware measuresystem catalog base tables only2022-10-21 11:29MIT License
714Number of system-generated and user-defined constraint names by constraint type (constraints that involve more than one column)Find the number of system-generated constraint names by constraint type. Names should follow the same style. If there is a mix of system-generated and user-defined names, then the style is most probably different.Sofware measuresystem catalog base tables only2023-01-10 14:53MIT License
715Number of system-generated and user-defined constraint names by constraint type (constraints that involve one column)Find the number of system-generated constraint names by constraint type. Names should follow the same style. If there is a mix of system-generated and user-defined names, then the style is most probably different.Sofware measuresystem catalog base tables only2023-01-10 14:52MIT License
716The number of table constraints with the cardinality bigger than oneFind the number of table constraints with the cardinality bigger than one. Find the number, based on the cardinality, constraint type, and cardinality+constraint type.Sofware measuresystem catalog base tables only2020-11-19 13:29MIT License
717The number of tables by schema, by type, and in totalFind the number of tables (base, foreign, and derived) in different schemas.Sofware measureINFORMATION_SCHEMA+system catalog base tables2021-03-07 10:57MIT License
718The proportion of mandatory and optional textual base table columnsFind the number of textual base table columns, the number of optional textual base table columns (permit NULLs), and the number of mandatory textual base table columns (do not permit NULLs).Sofware measureINFORMATION_SCHEMA only2021-01-15 17:39MIT License
719The 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
720The number of user-defined non-trigger routines by schema, by language, and by routine typeFind the number of user-defined non-trigger routines based on their schema, language, and routine type. The routines can be used to implement virtual data layer. Thus the queriy gives some indications about the possible extent of the layer.Sofware measureINFORMATION_SCHEMA+system catalog base tables2024-01-14 20:53MIT License