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...
221Perhaps a CHECK constraint about required personal name components is missingFind base tables that have optional columns for recording both given name and surname and do not have a CHECK constraint that requires that at least one of the name components must be registered in case of each person.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-10-31 01:16MIT License
222Perhaps a unneccessary surrogate keyFind base tables that have the primary key that is not a surrogate key and an alternate key that is a surrogate key. Perhaps the surrogate key column is not needed.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-03-07 20:59MIT License
223The name of the base table that implements a binary relationship type does not explain the meaning of the relationshipFind base tables that implement a binary relationship type (have two foreign keys) and the name of the table consist of the names of tables that this (intermediate) table connect. The names should be derived from the domain. For instance, instead of name Course_Lecturer it is better to have name Teaching.Problem detectionsystem catalog base tables only2023-03-18 17:58MIT License
224Do not use a generic attribute tableFind base tables that implement a highly generic database design (EAV design - Entiry-Attribute-Value design), according to which attribute values are recorded in a generic table that contains attribute-value pairs.Problem detectionINFORMATION_SCHEMA only2021-03-07 17:40MIT License
225Many-to-many relationship types that do not have additional attributesFind base tables that implement many-to-many relationship types that do not permit repeating relationships. More specifically find tables that have two or more foreign keys and all the columns of the table are either foreign key columns or a surrogate key column. It could be that during the system analysis a mistake has been made and some attributes of the entity type that represents the relationship type have not been discovered.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-01-21 10:48MIT License
226Many-to-many relationship types that do not permit repeating relationships and do not have additional attributesFind base tables that implement many-to-many relationship types that do not permit repeating relationships. More specifically find tables that have two or more foreign keys and all the columns of the table belong to a foreign key. In addition, all the table columns must be covered by a primary key or unique constraint. It could be that during the system analysis a mistake has been made and some attributes of the entity type that represents the relationship type have not been discovered.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-03-28 12:04MIT License
227Do not create multiple columns for the same attributeFind base tables that implement recording multivalued attribute values with the help of repeating group of columns. Find base tables that have more than one columns with the same type and field size and the difference between the columns are the numbers in the column names (column1, column2, etc.).Problem detectionINFORMATION_SCHEMA only2021-03-18 15:57MIT License
228Prefixes of base table namesFind base tables that name starts with a prefix. Do not use prefixes in case of base table names. Derive the names from the names of entity types. Do not use "_", "t_", "tab_", "t11_" etc as prefixes of a table.Problem detectionINFORMATION_SCHEMA only2022-11-15 16:32MIT License
229All the non-primary key columns are optionalFind base tables where all he non-primary key columns are optional. Avoid too many optional columns. You have to be extra careful with NULLs in case of formulating search conditions of data manipulation statements.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
230Base tables where all the columns are optionalFind base tables where all the columns are optional, i.e., permit NULLs. In such tables can be rows with no identity value and thus indistinguishable from other rows.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
231All columns of a base table have a default valueFind base tables where all the columns have a default value.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
232All unique keys have at least one optional columnFind base tables where all unique keys (sets of columns covered by a unique constraint, or a unique index) have at least one optional column. In this case there can be rows in the table where the values that should identify the row are missing. Because NULL is not a value and is not duplicate of another NULL the, follwing is possible: CREATE TABLE Uniq(a INTEGER NOT NULL,
b INTEGER,
CONSTRAINT ak_uniq UNIQUE (a, b));

INSERT INTO Uniq(a, b) VALUES (1, NULL);
INSERT INTO Uniq(a, b) VALUES (1, NULL);
Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-10-21 11:54MIT License
233Perhaps a redundant column (based on sequence generators)Find base tables where more than one column gets the default value by using the sequence generator mechanism.Problem detectionINFORMATION_SCHEMA only2021-03-05 09:42MIT License
234Multiple columns in the same base table that are associated with a sequence generatorFind base tables where multiple columns are associated with a sequence generator. Do not create unnecessary sequence generators. If one uses in a table a surrogate key, then it is enough to have one column where the values are generated by using a (external or internal) sequence generator.Problem detectionINFORMATION_SCHEMA only2021-03-08 00:41MIT License
235Base 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
236Empty 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
237Base 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
238Base tables with multiple comment columnsFind base tables with more than one comment columnsGeneralINFORMATION_SCHEMA only2021-04-02 12:21MIT License
239Base tables with multiple name columnsFind base tables with more than one name columns. Perhaps the normalization level of the table is low.GeneralINFORMATION_SCHEMA only2021-04-02 12:21MIT License
240Base 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