Seq nr | Name▲ | Goal | Type | Data source | Last update | License | ... |
---|---|---|---|---|---|---|---|
1 | BOOLEAN base table and foreign table columns with a CHECK constraint that involves olnly this column | Find base table and foreign table columns with the Boolean type that has a CHECK constraint that involves only this column. Avoid unnecessary CHECK constraints. The Boolean type contains only two values and there is nothing to check. By creating a check that determines that possible values in the column are TRUE and FALSE, one duplicates the attribute constraint (column has a type). This is a form of duplication. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:29 | MIT License | |
2 | CHECK constraints with the cardinality bigger than one that involve the same set of columns | CHECK constraints with the cardinality bigger than one that involve the same set of columns. Make sure that there is no duplication. | General | system catalog base tables only | 2023-12-25 12:39 | MIT License | |
3 | Domain CHECK constraints with the same name | Find domain check constraint names that are used more than once (within the same schema or in different schemas). Different things should have different names. However, here different constraints have the same name. Also make sure that this is not a sign of duplication of domains. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:30 | MIT License | |
4 | Domains with the same name in different schemas | Domains are like words that can be used to construct generalized claims about the real world (table predicates). Better not to duplicate the words in the dictionary. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:30 | MIT License | |
5 | Do not clone tables | Find cases where a base table has been split horizontally into multiple smaller base tables based on the distinct values in one of the columns of the original table. Each such newly created table has the name, a part of which is a data value from the original tables. Find base tables that have the same columns (column name, column order, data type) and the difference between the tables are the numbers in the table names (table1, table2, etc.). | Problem detection | INFORMATION_SCHEMA only | 2021-03-18 14:43 | MIT License | |
6 | Double checking of the maximum character length | Do not duplicate code. In this case a CHECK constraint duplicates the restriction that is already enforced with the help of the declaration of the maximum field size (for instance, VARCHAR(100)). | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-11-18 13:27 | MIT License | |
7 | Duplicate CHECK constraints that are connected directly to a table | The same table should not have multiple CHECK constraints with exactly the same Boolean expression. Do remember that the same task can be solved in SQL usually in multiple different ways. Thus, the exact copies are not the only possible duplication. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:30 | MIT License | |
8 | Duplicate CHECK constraints that are connected to a domain | The same domain should not have multiple CHECK constraints with exactly the same Boolean expression. Do remember that the same task can be solved in SQL usually in multiple different ways. Thus, the exact copies are not the only possible duplication. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:30 | MIT License | |
9 | Duplicate check of empty strings | Find columns that have a check that prevents the empty string in the column but there is already another check on the column that enforces the constraint. If there is a constraint description!~'^[[:space:]]*$', then it covers the constraint description!='' and the latter becomes redundant. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-12-19 15:08 | MIT License | |
10 | Duplicate DEFAULT values of base table columns | Find base table columns that have both default value determined through a domain and default value that is directly attached to the column. Do not duplicate specifications of default values to avoid confusion and surprises. If column and domain both have a default value, then in case of inserting data the default value that is associated directly with the column is used. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:30 | MIT License | |
11 | Duplicate domains | Find domains that have the same properties (base type, character length, not null + check constraints, default value, collation). There should not be multiple domains that have the same properties. Do remember that the same task can be solved in SQL usually in multiple different ways. Therefore, the domains may have syntactically different check constraints that solve the same task. Thus, the exact copies are not the only possible duplication. | Problem detection | INFORMATION_SCHEMA only | 2024-11-21 15:14 | MIT License | |
12 | Duplicate enumerated types | Find enumerated types with exactly the same values. There should not be multiple types that have the same values. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:30 | MIT License | |
13 | Duplicate foreign key constraints | Find duplicate foreign key constraints, which involve the same columns and refer to the same set of columns. | Problem detection | system catalog base tables only | 2021-02-25 17:30 | MIT License | |
14 | Duplicate independent (i.e., not created based on a table) composite types | Find composite types with the same attributes (regardless of the order of attributes). Make sure that there is no duplication. | Problem detection | system catalog base tables only | 2021-02-25 17:29 | MIT License | |
15 | Duplicate keys | Find completely overlapping key (primary key and unique) constraints. This is a form of duplication. It leads to the creation of multiple indexes to the same set of columns. | Problem detection | system catalog base tables only | 2021-10-16 10:27 | MIT License | |
16 | Duplicate materialized views | Find materialized views with exactly the same subquery. There should not be multiple materialized views with the same subquery. Do remember that the same task can be solved in SQL usually in multiple different ways. Thus, the exact copies are not the only possible duplication. | Problem detection | system catalog base tables only | 2021-02-25 17:30 | MIT License | |
17 | Duplicate NOT NULL constraints | Find columns that have NOT NULL constraint through a domain and also directly. Do not duplicate NOT NULL constraints in orde to avoid confusion and surprises. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:30 | MIT License | |
18 | Duplicate removal of duplicates in derived tables | Find derived tables (views and materialized views) that contain both DISTINCT and GROUP BY. Make sure that the means for removing duplicate rows from the query result are not duplicated. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:29 | MIT License | |
19 | Duplicate rules | Find multiple rules with the same definition (event, condition, action) on the same table. Do remember that the same task can be solved in SQL usually in multiple different ways. Thus, the exact copies are not the only possible duplication. | Problem detection | system catalog base tables only | 2021-02-25 17:30 | MIT License | |
20 | Duplicate specification of character classes | Find regular expressions where within the same specification of a character class the character class alnum as well as 0-9, \d, A-Z, or a-z has been defined. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-12-24 10:43 | MIT License |