Seq nr | Name | Goal | Type | Data source▲ | Last update | License | ... |
---|---|---|---|---|---|---|---|
181 | The number of domains by schema and in total | Identify the number of domains in different schemas. | Sofware measure | INFORMATION_SCHEMA only | 2020-11-06 14:51 | MIT License | |
182 | The number of sequence generators in different schemas | Identify the number of sequence generators in different schemas. Surrogate key values must be generated by using the system (the sequence generator mechanism in case of PostgreSQL). If there are no sequence generators, then there is a question as to whether there are no surrogate keys in the database at all (could be possible and OK) or (more probable) developers have forgotten to implement the generation of surrogate keys at the database level. An alternative is to implement generation of unique values at the application level or at the database level by using triggers. However, such implementation would most probably lead to the performance penalty because adding new rows to the table must be serialized, i.e., it can be done in one session at a time. | Sofware measure | INFORMATION_SCHEMA only | 2021-03-07 20:55 | MIT License | |
183 | The number of user defined triggers by different characteristics | Find the number of user defined triggers by action orientation (ROW, STATEMENT), action timing (BEFORE, AFTER, INSTEAD OF), and event type (INSERT, UPDATE, DELETE) and their combinations. | Sofware measure | INFORMATION_SCHEMA only | 2024-01-14 17:41 | MIT License | |
184 | The proportion of mandatory and optional textual base table columns | Find 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 measure | INFORMATION_SCHEMA only | 2021-01-15 17:39 | MIT License | |
185 | The proportion of using different integer types as types of base table columns | Find the number of base table columns that use different integer types (SMALLINT, INTEGER, BIGINT) and their proportion from the overall set of columns that use an integer type. | Sofware measure | INFORMATION_SCHEMA only | 2021-03-03 12:41 | MIT License | |
186 | The same sequence generator is used in case of multiple columns | Do not cause a potential performance bottleneck by having a shared resource. By having a shared sequence it is not possible to change properties of sequences of different tables independently (for instance the owner column or step), i.e., it increases coupling between tables. By having a shared sequence it is impossible to specify the owner (table column) to the sequence generator. | Problem detection | INFORMATION_SCHEMA only | 2021-03-07 21:07 | MIT License | |
187 | The same trigger function is used in case of multiple tables | Find trigger functions that are used in case of more than one table. Although it is legal, one must be careful when changing the functions in order to avoid unwanted consequences. | General | INFORMATION_SCHEMA only | 2020-12-25 14:50 | MIT License | |
188 | Three-valued logic (Boolean columns) | Find base table columns that have Boolean type and do not have NOT NULL constraint. 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. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:30 | MIT License | |
189 | Too generic names (domain constraints) | Find domain CHECK constraints that have a too generic name - for instance, the name contains word "data" ) or the name is an abbreviation of the constraint type name (for instance, "chk" or "chk1"). | Problem detection | INFORMATION_SCHEMA only | 2021-10-31 17:39 | MIT License | |
190 | Too short domain constraint names | Find names of domain constraints that are shorter than the length of the name of the domain + two characters. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:29 | MIT License | |
191 | Too short view names | Names should be expressive. Find views that name is shorter than the average length of the the names of its directly underlying tables (both base tables and derived tables). | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:29 | MIT License | |
192 | Unnecessary usage of the numeric type in case of base table columns | Find base table columns that have type NUMERIC and the scale is 0, i.e., one can record in the column only integer values. Arithmetic operations are slower in case of the numeric type compared to an integer type. Thus, in order to record integer values, one should use columns with the type SMALLINT, INTEGER, or BIGINT instead of NUMERIC(p,0). | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:30 | MIT License | |
193 | Unused foreign data wrappers | Find foreign data wrappers that do not have any associated foreign servers. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:30 | MIT License | |
194 | Unused foreign servers | Find foreign servers that do not have any associated foreign tables. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:30 | MIT License | |
195 | Updatable views that do not have WITH CHECK OPTION constraint | Find updatable views that do not have WITH CHECK OPTION constraint. WITH CHECK OPTION constraint prevents updates through the view that violate the predicate of the view. Such updates must be prevented. | Problem detection | INFORMATION_SCHEMA only | 2023-10-29 10:33 | MIT License | |
196 | Updatable views with WHERE clause that do not have WITH CHECK OPTION constraint | Find updatable views that restrict rows, i.e., have WHERE clause, but do not have WITH CHECK OPTION constraint. WITH CHECK OPTION constraint prevents updates through the view that violate the predicate of the view. Such updates must be prevented. | Problem detection | INFORMATION_SCHEMA only | 2024-01-14 17:11 | MIT License | |
197 | Updataple foreign tables that refer to another PostgreSQL table | Find foreign tables that have been defined based on postgresql_fwd foreign data wrapper and that are updatable. Make sure that updatability is in this case needed. | General | INFORMATION_SCHEMA only | 2020-11-06 17:15 | MIT License | |
198 | UPDATE triggers | Find all UPDATE triggers. Make sure that they specify a correct set of columns in which data modification will fire the trigger. | General | INFORMATION_SCHEMA only | 2023-12-22 09:47 | MIT License | |
199 | UPDATE triggers that maybe execute too often | Do not let the system to do extra work. Ensure that trigger procedures are executed only if there is a real need of that. Find UPDATE triggers that could be executed too often because unneeded executions are not prevented. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:29 | MIT License | |
200 | Use invocation of a precise function instead of casting in a default value expression | Be precise and write as little code as possible. Prefer expressions with simple invocations of functions like localtimestamp, current_timestamp, and current_date over expressions like (now())::date. Find table columns that have a default value that casts the type of the returned value of a non-deterministic function (now, localtimestamp, current_timestamp, and current_date). | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:29 | MIT License |