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...
401Chains of ON DELETE CASCADEFind all referential paths (chains of of parent-child tables that are associated through foreign key constraints) where all foreign key constraints have ON DELETE CASCADE compensating actions. Be careful with too long chains.Generalsystem catalog base tables only2022-10-29 20:04MIT License
402Number of rows in base tablesFind the number of rows in base tables.Generalsystem catalog base tables only2022-10-27 19:44MIT License
403System-generated domain CHECK constraint namesFind the names of domain CHECK constraints that have been system-generated. 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.Problem detectionINFORMATION_SCHEMA only2022-10-27 15:44MIT License
404Logical size of a schemaThe schema size is the sum of the sizes of all tables in the schema.Sofware measureINFORMATION_SCHEMA+system catalog base tables2022-10-21 16:18MIT License
405Logical size of a tableThe table size is the sum of the total size of the simple columns and the total size of the complex columns in the table. In case of SQL databases large base tables in terms of number of columns could be a side effect of the problems with cloned columns or multiple columns for the same attribute. A base table with a low normalization level, which is meant to hold data that corresponds to multiple entity types has typically also relatively large number of columns compared with other base tables. Thus, the normalization level of base tables with a large number of columns should be checked as well.Sofware measureINFORMATION_SCHEMA+system catalog base tables2022-10-21 16:17MIT License
406Recursive rules that directly modify their home tableDo not cause potentially infinite loops. Recursive rules would fire itself over and over again. Although the system is able to detect these after executing a data modification statement it is better to avoid creating these altogether.Problem detectionsystem catalog base tables only2022-10-21 15:59MIT License
407Optional base table columns that participate in a UNIQUE constraint or indexFind optional base table columns that participate in a UNIQUE constraint or index. Each base table has one or more candidate keys. One of these is usually selected to be the primary key, other are called alternate keys. To enforce an alternate key one should define a UNIQUE constraint and determine that all the key columns are mandatory (NOT NULL) just like the primary key columns are mandatory. Make sure that the NOT NULL constraint is not missing on these columns.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-10-21 15:57MIT License
408Definition 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
409Empty tablesFind base tables where the number of rows is zero. If there are no rows in a table, then it may mean that one hasn't tested constraints that have been declared to the table or implemented by using triggers. It could also mean that the table is not needed because there is no data that should be registered in the table.Problem detectionsystem catalog base tables only2022-10-21 15:55MIT License
410Privileges on the database and its schemas, domains, types, languages, sequences, foreign data wrappers, and foreign servers that have been granted to a superuserFind privileges on the database and its schemas, domains, types, languages, sequences, foreign data wrappers, and foreign servers that have been granted to a superuser. Superuser can do anything in the database and thus does not need the privileges. The result is a sign that perhaps the executed GRANT statements were incorrect (wrong username) or the grantee later got superuser status (that it shouldn't have).Problem detectionsystem catalog base tables only2022-10-21 15:53MIT License
411The 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
412Base tables with plenty of dataFind base tables that have 1000 rows or more.Generalsystem catalog base tables only2022-10-21 11:25MIT License
413Disabled rulesIdentify disabled rules. These should be enabled or dropped, otherwise these are dead code.Problem detectionsystem catalog base tables only2022-10-21 11:22MIT License
414The 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
415Optional non-foreign key base table columns that participate in a UNIQUE constraint or indexFind optional base table columns that participate in a UNIQUE constraint or index but do not participate in a foreign key constraint. Each base table has one or more candidate keys. One of these is usually selected to be the primary key, other are called alternate keys. To enforce an alternate key one should define a UNIQUE constraint and determine that all the key columns are mandatory (NOT NULL) just like the primary key columns are mandatory. Make sure that the NOT NULL constraint is not missing on these columns.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-10-21 10:45MIT License
416Names of constraints (directly connected to a base table) and non-unique indexes that do not contain the associated column nameFind constraints that are perhaps badly named. Find names of constraints (directly connected to a base table) and non-unique indexes that do not contain the associated column name.Problem detectionsystem catalog base tables only2022-10-21 10:41MIT License
417Base 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
418Foreign key references to a unique index columns not a unique key columnsFind foreign key constraints that reference to the columns that are covered by a unique index not a unique key.Problem detectionsystem catalog base tables only2022-10-21 10:30MIT License
419Duplicate non-fuction based unique indexesFind pairs of non-function based unique indexes that cover the same set of columns. Include indexes that support a constraint (primary key, unique, exclude), i.e., these indexes have been automatically created due to the constraint declaration. For instance, it helps us to find unique indexes that have been defined to already unique columns.Problem detectionsystem catalog base tables only2022-10-21 10:17MIT License
420Base 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