Seq nr | Name | Goal | Type | Data source▲ | Last update | License | ... |
---|---|---|---|---|---|---|---|
881 | Not inherited CHECK constraints that cover at least one column | Find CHECK constraints that cover at least one column and that have been defined in a supertable (parent table) but not in its subtables. An entity that belongs to a subtype should also belong to its supertype. If a subtype entity satisfies some constraint, then logically it must also satisfy the constraints of the supertype as well. If CHECK constraints are not inherited, then this is not guaranteed. If you implement subtyping not merely reuse implementation in the subtables, then the subtables must have at least the same CHECK constraints as the supertable. | Problem detection | system catalog base tables only | 2021-02-25 17:29 | MIT License | |
882 | NOT VALID foreign key constraints | Find not valid foreign key constraints. These constraints have been created so that the existing data has not been checked against the constraint. It could be deliberate in case of legacy systems that have data quality problems. However, ideally all the data in the table conforms to the constraint. | Problem detection | system catalog base tables only | 2021-02-25 17:30 | MIT License | |
883 | Number of rows in base tables | Find the number of rows in base tables. | General | system catalog base tables only | 2022-10-27 19:44 | MIT License | |
884 | Number 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 measure | system catalog base tables only | 2023-01-10 14:53 | MIT License | |
885 | Number 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 measure | system catalog base tables only | 2023-01-10 14:52 | MIT License | |
886 | ON DELETE CASCADE is probably missing (based on the multiplicity of the relationship) | Find foreign key constraints that completely overlap with a candidate key constraint (primary key or unique constraint) but the foreign key constraint does not have the ON DELETE CASCADE compensating action. In this case there is a foreign key that implements a relationship type between a strong entity type and a weak entity type (1-1 relationship type). Therefore, in this case ON DELETE CASCADE is an appropriate compensating action. | Problem detection | system catalog base tables only | 2021-02-25 17:29 | MIT License | |
887 | ON DELETE CASCADE is probably not needed (based on the relationship type) | Find foreign key constraints that implement a non-identifying relationship type and have ON DELETE CASCADE compensating action. If the identity of the parent table is not a part of the identity of the child table, then there is a non-identifying relationship type and most probably the foreign key should not have ON DELETE CASCADE. | Problem detection | system catalog base tables only | 2023-10-28 18:38 | MIT License | |
888 | ON DELETE SET NULL is probably missing | Find implementations of the adjacency list design pattern, where the corresponding foreign key columns are optional but the foreign key constraint does not have ON DELETE SET NULL compensating action. Implement adjacency list correctly. | Problem detection | system catalog base tables only | 2021-02-25 17:29 | MIT License | |
889 | One-to-one relationships | Find one-to-one relationships between base tables. In this case the foreign key columns must have primary key or unique constraint. These tables could implement inheritance hierarchy that has been specified in the conceptual data model. | General | system catalog base tables only | 2023-01-06 13:39 | MIT License | |
890 | One true lookup table | Find tables that contain all (or most) of the classifier values and tables that refer to these. | Problem detection | system catalog base tables only | 2021-02-25 17:29 | MIT License | |
891 | ON UPDATE CASCADE is perhaps missing (based on the compensating actions of other foreign key constraints) | Find inconsistencies of using ON UPDATE CASCADE in case of foreign key constraints. An example of inconsistency is that there are two foreign key constraints in different tables that refer to the same table and its candidate key. One of the constraints has ON UPDATE CASCADE compensating action one does not. ON UPDATE CASCADE usage should be consistent, otherwise it does not allow us to change key values in the primary table. More generally, there is a set of foreign key constraints F that refer to a candidate key of table T. It cannot be the case that a proper non-empty subset of these foreign keys have ON UPDATE CASCADE compensatory action. Either all the constraints in F should have it or none of it should have it (depending on circumstances). | Problem detection | system catalog base tables only | 2022-04-30 18:39 | MIT License | |
892 | ON UPDATE CASCADE is probably missing (based on column names) | Find foreign key constraints that do not feature ON UPDATE CASCADE compensating action although people have a reason to change the key value in the primary table by assuming that the names of foreign key columns correctly point towards the use of natural keys in the table. | Problem detection | system catalog base tables only | 2023-11-16 11:59 | MIT License | |
893 | Optional composite foreign keys that do not have MATCH FULL specified | Find optional composite foreign keys that do not have MATCH FULL specified. Without MATCH FULL the system will permit partial foreign key values | Problem detection | system catalog base tables only | 2021-02-25 17:29 | MIT License | |
894 | Overlapping non-function based indexes that have the same leading column but with different operator class | Find non-function based indexes (both unique and non-unique) that have identical first column but the operator class that is used in case of the first column is different. Include unique indexes that support a constraint (primary key, unique, exclude), i.e., these indexes have been automatically created due to the constraint declaration. | General | system catalog base tables only | 2023-10-28 15:05 | MIT License | |
895 | Overlapping non-function based indexes that have the same leading column with the same operator class | Find non-function based indexes (both unique and non-unique) that duplicate each other because their first column is identical and the operator class that is used in case of the first column is identical. Include unique indexes that support a constraint (primary key, unique, exclude), i.e., these indexes have been automatically created due to the constraint declaration. | Problem detection | system catalog base tables only | 2023-11-26 15:59 | MIT License | |
896 | Patterns of the names of columns of simple primary keys | Find the patterns of the names of columns of simple primary keys. Make sure that the naming is consistent. Ideally, the names should indicate as to whether the column is a surrogate or a natural key column. PostgreSQL 14 added primary keys, unique constraints, and foreign keys to system catalogs. Thus the query was modified to exclude the results from the system catalog. | General | system catalog base tables only | 2023-01-20 13:40 | MIT License | |
897 | Percentage of the total index storage size from the total database storage size (system catalog included) | Get overview of disk usage. | Sofware measure | system catalog base tables only | 2020-11-06 14:51 | MIT License | |
898 | Perhaps an inconsistent use of NO ACTION and RESTRICT in the foreign key declarations | Find as to whether in case of foreign key constraints both the compensating actions RESTRICT and NO ACTION are used within the same database. If the same thing has to do in different places, then try to do it in the same way. | Problem detection | system catalog base tables only | 2021-02-25 17:29 | MIT License | |
899 | Perhaps a relationship should be irreflexive | Enforce all the constraints. A binary relation is called irreflexive, if it does not relate any element to itself. | Problem detection | system catalog base tables only | 2021-02-25 17:29 | MIT License | |
900 | Perhaps a too generic foreign key column name | Find the names of foreign key columns that are too generic. The expressive names of table columns allow database users better and more quickly understand the meaning of data in the database. A person could participate in a process or be associated with an object due to different reasons. Thus, foreign key column names like isik_id, person_id, tootaja_id, worker_id etc. are too generic. The name should refer (also) to the reason why the person is connected. | Problem detection | system catalog base tables only | 2023-03-15 18:27 | MIT License |