Filter Queries

Found 1050 queries.

  • All the queries about database objects contain a subcondition to exclude from the result information about the system catalog.
  • Although the statements use SQL constructs (common table expressions; NOT in subqueries) that could cause performance problems in case of large datasets it shouldn't be a problem in case of relatively small amount of data, which is in the system catalog of a database.
  • Statistics about the catalog content and project home in GitHub that has additional information.

# Name Goal Type Data source â–² Last update License
1021 The same CHECK has a different name in different places Find the names of table CHECK constraints that have the same Boolean expression but a different naming style in different places (tables). The naming of constraints should be consistent. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code)x Problem detection system catalog base tables only 2025-11-07 10:11 MIT License View
1022 The same CHECK has a different name in different places (2) This query audits the database schema to enforce a uniform naming strategy for CHECK constraints. It identifies inconsistencies where constraints enforcing identical Boolean expressions are named using disparate patterns across different tables. To isolate the naming pattern from specific object identifiers, the query normalizes the constraint names by substituting the actual table name with the generic token TABLE. This allows it to detect violations of the "Clean Code" principle of consistency—flagging cases where the same logical rule is implemented with a specific naming convention in one context (e.g., chk_TABLE_column) but a different convention in another (e.g., TABLE_column_check). Problem detection system catalog base tables only 2025-11-27 10:17 MIT License View
1023 The size of base tables and their indexes Find the size of base tables without indexes, size of the indexes of the table, total size of the table (including its indexes) and percentage of the index size from the total size. If the size of indexes of a table is relatively high, then check as to whether all the indexes are needed. General system catalog base tables only 2025-11-07 10:11 MIT License View
1024 The storage size of each index (the system catalog excluded) Get overview of disk usage. Sofware measure system catalog base tables only 2025-11-07 10:11 MIT License View
1025 The storage size of each schema data object (the system catalog excluded) Get overview of disk usage by different schema objects that contain user data. Sofware measure system catalog base tables only 2025-11-07 10:11 MIT License View
1026 The storage size of each table (including indexes) (the system catalog excluded) Get overview of disk usage. Sofware measure system catalog base tables only 2025-11-07 10:11 MIT License View
1027 The total size of all indexes (system catalog excluded) Sofware measure system catalog base tables only 2025-11-07 10:11 MIT License View
1028 The total size of all tables (system catalog excluded) Sofware measure system catalog base tables only 2025-11-07 10:11 MIT License View
1029 The total storage size of all indexes (the system catalog excluded) Get overview of disk usage. Sofware measure system catalog base tables only 2025-11-07 10:11 MIT License View
1030 The total storage size of the database (the system catalog included) Get overview of disk usage. Sofware measure system catalog base tables only 2025-11-07 10:11 MIT License View
1031 Timezone-aware logic on timezone-unaware columns This query identifies logically flawed CHECK constraints on columns with timezone-unaware data types (DATE and TIMESTAMP WITHOUT TIME ZONE). It specifically targets constraints that contain timezone-aware logic (e.g., using AT TIME ZONE). This represents a critical semantic mismatch: the data type stores a "naive" or "local" time with no timezone context, while the constraint attempts to evaluate it within a specific timezone. The outcome of such a check is non-deterministic, as it depends on the session's current TimeZone setting, leading to unpredictable and unreliable data validation. This is a design flaw; if timezone-aware logic is required, the column should use the TIMESTAMP WITH TIME ZONE (TIMESTAMPTZ) data type. Problem detection system catalog base tables only 2025-11-15 09:58 MIT License View
1032 Too generic names (candidate key columns) Find candidate key columns with the names like id, identifikaator, code, kood, number, etc. The names should have a prefix or a suffix. These are too generic names. Problem detection system catalog base tables only 2025-11-07 10:11 MIT License View
1033 Too generic names (foreign key columns) Find foreign key columns with the names like id, identifikaator, code, kood, number, etc. The names should have a prefix or a suffix that describes the nature of relationship with the referenced table or at least referes to the referenced table. These are too generic names. Problem detection system catalog base tables only 2025-11-07 10:11 MIT License View
1034 Too generic names (table constraints) Find table constraints (constraints that are associated directly with the table) that have too generic names like "key" or the name contain too generic words like "data" (all constraints restrict data in the table), or the name is an abbreviation of a constraint type name. Problem detection system catalog base tables only 2025-11-07 10:11 MIT License View
1035 Too generic names (unique index columns) Find unique index (not associated with a constraint) columns with the names like id, identifikaator, code, kood, number, etc. The names could have underscores as the prefix or suffix. These are too generic names. Problem detection system catalog base tables only 2025-11-07 10:11 MIT License View
1036 Too generic names (unique indexes) Find unique indexes that have too generic names like "key" or the name contain too generic words like "data" (all constraints restrict data in the table), or the name is an abbreviation of a constraint type name. Problem detection system catalog base tables only 2025-11-07 10:11 MIT License View
1037 Too generic names (user-defined types, domains) Find names of user-defined types and domains that contain too generic (noise) words. Problem detection system catalog base tables only 2025-11-07 10:11 MIT License View
1038 Too short table constraint names The names should be expressive. Find names of constraints, which are associated directly to a table, that are shorter than the length of the name of the table + two characters. Problem detection system catalog base tables only 2025-11-07 10:11 MIT License View
1039 Too wide composite indexes Find composite indexes that do not support any constraint but are on more than three columns. Problem detection system catalog base tables only 2025-11-07 10:11 MIT License View
1040 Triggers that are used to calculate tsvector values react to a wrong set of events Find triggers on base tables that are used to calculate tsvector values that react to a wrong set of events, i.e., react to the DELETE event or do not react to the INSERT and UPDATE events. Problem detection system catalog base tables only 2025-11-07 10:11 MIT License View