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...
461Meaningless terms in routinesFind routines that subquery contains terms "foo", "bar", "foobar", or "baz".Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-01-06 14:09MIT License
462Median and average number of subcomponents in the names of database objects"Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should be expressive. Find the median and average (arithmetic mean) number of subcomponents in the names of user-defined database objects. The values could be used to compare different databases.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-03-17 10:07MIT License
463Median and average of the length of names of database objects"Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should be expressive. Find the median length and average (arithmetic mean) length of the names (identifiers) of user-defined database objects. The values could be used to compare different databases.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-03-18 17:05MIT License
464Median and average of the length of names of database objects by the object type"Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should be expressive. Find the median length and average (arithmetic mean) length of the names (identifiers) of user-defined database objects by the object type. The values could be used to compare different databases.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-03-17 01:08MIT License
465Middle-manFind a routine that's only task is to invoke another routine. If a routine performs only one action, delegating work to another routine, why does it exist at all?Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-05 12:48MIT License
466Minimum 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
467Missing USAGE privileges on schemaIf a user has a privilege to use a schema object, then the user must also have the usage privilege on the schema that contains the object.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-21 12:06MIT License
468Mixing Concat and ||Find cases where different means are used to concatenate text within the same object.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-12-03 14:36MIT License
469Mixing Concat and CoalesceFind cases where different means are used to deal with NULLs in case of concatenating texsts.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-12-08 14:25MIT License
470Mixing different mechanisms to generate surrogate valuesUse the same mechanism of generating surrogate key values throughout the database. The use of SERIAL notation/explicitly creating a sequence generator and declaration of a column as an identity column will cause the creation of an external and internal sequence generator, respectively. Nevertheless, one should try to stick with using one of the mechanisms in order to cause less confusion. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code)Problem detectionINFORMATION_SCHEMA only2021-03-08 00:42MIT License
471Mixing the use of TEXT and VARCHAR type in case of base table columnsDeclaring a column to have the type TEXT or the type VARCHAR (without the maximum number of characters) has the same end result in terms of what data can be recorded in the column. Nevertheless, one should try to stick with using one of the type names in order to cause less confusion. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code)Problem detectionINFORMATION_SCHEMA only2021-03-12 15:06MIT License
472More than one index on a columnFind base table columns that belong to more than one index (including automatically created indexes that support constraints).Generalsystem catalog base tables only2021-11-10 14:44MIT License
473Multiple 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
474Multiple deletes from the same table in a routineCode should be as compact as possible and system should make as little work as necessary in order to solve a task. Thus, instead of deleting different rows of the same table with different DELETE statements one should try to do it with one statement. The query excludes routines where IF statement is used.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-01-24 14:15MIT License
475Multiple inheritanceFind instances of multiple inheriance of base tables. Make sure that multiple inheritance is indeed needed.Generalsystem catalog base tables only2020-11-15 12:20MIT License
476Multiple RETURNING clauses in a SQL functionFind SQL functions that have multiple statements with the RETURNING clause.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-12-21 13:59MIT License
477Multiple selects from the same table in a routineCode should be as compact as possible and system should make as little work as necessary in order to solve a task. Thus, instead of selecting different fields of the same row with different SELECT INTO statements one should try to do it with one statement.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-04 12:10MIT License
478Multiple 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
479Multiple tables share the same state classifierFind cases where multiple tables share the same state classifier. For each main entity type one should create a separate state classifier table. Even if the classifier values are the same in case of two entity types for now these may become different in the future. Having a shared state classifier table usually means very simplistic state machines (states active and inactive) that could point to the gaps in analysis.Problem detectionsystem catalog base tables only2023-12-30 15:51MIT License
480Multiple 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