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...
201Candidate keys where all columns have a static default valueFind base table primary key and unique constraints where all columns probably have a static default value. Candidate key columns (columns that belong to the primary key or to an unique constraints) shouldn't have static default values unless you are enforcing a rule that a table can have at most one row. The point of default values is that system assigns them automatically. There cannot be multiple rows with the same key value.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-12 11:33MIT License
202At most one row is permitted in a table (based on check constraints)Find base tables and foreign tables where based on a check constraint, a key constraint, and a NOT NULL constraint can be at most one row. Make sure that this is the real intent behind the constraint, not a mistake. Find tables where a check constraint permits only one possible value in a column, the column has NOT NULL constraint, and constitutes a key, i.e., has the PRIMARY KEY or UNIQUE constraint.GeneralINFORMATION_SCHEMA+system catalog base tables2022-11-03 15:21MIT License
203At most one row is permitted in a table (based on enumeration types)Find base tables and foreign tables where based on the type of a column, a key constraint, and a NOT NULL constraint can be at most one row. Make sure that this is the real intent behind the constraint, not a mistake. Find tables where a column has an enumeration type with exactly one value, the column has NOT NULL constraint, and constitutes a key, i.e., has the PRIMARY KEY or UNIQUE constraint.GeneralINFORMATION_SCHEMA+system catalog base tables2022-11-03 15:18MIT License
204Base tables and materialized views without any indexFind base tables and materialized views that do not have any index.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-05 19:39MIT License
205Base table columns permitting temporal values that may be outside the range of logical valuesFind base tables columns with temporal types (date and timestamp) that do not belong to a foreign key and that do not have any associated simple CHECK constraints, i.e., constraint that involves only one column. For instance, in the column registration_time that does not have any associated CHECK constraints could be values '1200-01-01 00:00' or '5900-12-31 00:00'. Rows with these values most probably represent wrong propositions and the system should restrict registration of such data.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-12-17 00:40MIT License
206FILLFACTOR is probably too bigFind base tables in case of which the FILLFACTOR property has perhaps a too big value. Try to find base tables that probably encounter UPDATE operations. In the tables that have frequent updates you want to have free space in table pages (blocks) to accommodate new row versions, which the system automatically creates as a result of fulfilling UPDATE statements. If a new row version will be put to another page by the system, then it means that table indexes have to be updated as well. Thus, the more there are indexes, the more the table would benefit from keeping a new row version in the same page as the old version.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-12-17 00:22MIT License
207Minimum tuple length required before trying to move long column values into TOAST tables has been changedFind base tables in case of which toast_tuple_target storage parameter value is not the default value (2040). "Changing this value may not be useful for very short or very long rows. Note that the default setting is often close to optimal, and it is possible that setting this parameter could have negative effects in some cases. " Make sure that the parameter has an optimal value.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
208Base tables where certainly registration time is not recordedFind base tables that do not have any column with a timestamp type. In such tables certainly registration time is not recorded. Make sure as to whether recording registration time is necessary.GeneralINFORMATION_SCHEMA only2021-02-26 00:41MIT License
209Base tables that do not have a TOAST tableFind base tables that (due to the types of their columns) do not have an associated TOAST table for storing out-of-line data.Generalsystem catalog base tables only2020-11-06 14:51MIT License
210Base tables with plenty of dataFind base tables that have 1000 rows or more.Generalsystem catalog base tables only2022-10-21 11:25MIT License
211Perhaps last update time trigger is missingFind base tables that have a column for last update time but the table does not have associated before update row level trigger for changing the last update time.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-12-30 15:22MIT License
212Perhaps a CHECK constraint about the combination of truth values is missingFind base tables that have at least two columns that have Boolean type and have at least one Boolean column that is not covered by a CHECK constraint involving more than one Boolean column. The Boolean columns possibly mean that we want to record data about states. Often the states depend on each other. For instance, if an order is archived it must be inactive.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
213Perhaps a CHECK constraint about the order of events is missingFind base tables that have at least two columns that have DATE or TIMESTAMP (with or without time zone) type and do not have any associated CHECK constraint that involves two or more of these columns. The columns mean that we want to record data about events or processes, which often have a certain order. Hence, in case of each row of such a table the values in these columns must be in a certain order. For instance, the end of a meeting cannot be earlier than the beginning of the meeting.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
214Base tables created based on a typeFind base tables that have been created based on a composite type and thnk through as to whether it was really needed.Generalsystem catalog base tables only2020-11-06 14:51MIT License
215Base 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
216Base tables with multiple temporal columnsFind base tables that have more than one column with a temporal type (date or timestamp).GeneralINFORMATION_SCHEMA only2021-02-19 17:37MIT License
217Base tables with multiple Boolean columnsFind base tables that have more than one column with Boolean type.GeneralINFORMATION_SCHEMA only2021-02-19 17:41MIT License
218Multiple simple keys with integer valuesFind base tables that have more than one primary key or unique constraints that involve exactly one integer column. Do not overcomplicate the database. Perhaps some column in the table is redundant.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-11-03 11:15MIT License
219Duplicate stored generated base table columnsFind base tables that have more than one stored generated column with the same expression. The support of generated columns was added to PostgreSQL 12. 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 detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
220Multiple triggers that update tsvector valuesFind base tables that have multiple triggers to update tsvector values.Problem detectionsystem catalog base tables only2023-11-07 10:14MIT License