Filter Queries

Found 1041 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
921 The number of user-defined triggers by schema, by type, and in total Triggers can be used to maintain data integrity in a database by causing rejection of data that does not conform to certain rules. Therefore, the number of triggers in a database gives an indication about the state of enforcing constraints at the database level. Sofware measure INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View
922 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 2025-11-07 10:11 MIT License View
923 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 2025-11-07 10:11 MIT License View
924 There is no reason to use PL/pgSQL if you do not use one or more features of a procedural language Using PL/pgSQL may cause context switching between declarative SQL and procedural PL/pgSQL. Thus use PL/pgSQL only if you truly need some of its constructs (variables, conditional statements, cycles, cursors, exception handling). Problem detection INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View
925 There is no reason to use PL/pgSQL to write table functions Using PL/pgSQL may cause context switching between declarative SQL and procedural PL/pgSQL. Thus use PL/pgSQL only if you truly need some of its constructs. You can create table functions by using SQL. Problem detection INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View
926 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
927 The same database object name is used repeatedly in case the same database object type Find what database object names are used more than once in case the objects of the same type. If the names differ from each other only by digits or underscores, then consider these the same name. For instance, if there are base tables Person and Person2 (in the same schema or different schemas), then the query returns the name Person. Make sure that there is no duplication of implementation elements in the database. General INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View
928 The same name is used in different contexsts Find the names that are used in case of different types of elements Problem detection INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View
929 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 2025-11-07 10:11 MIT License View
930 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 2025-11-07 10:11 MIT License View
931 The shortest names of database objects by 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 shortest (identifiers) names of user-defined objects by their type. These could be the first candidates of renaming in order to give to database objects better names. General INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View
932 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
933 The SQL-language routines with the body that is string literal Find SQL-language routines that have the body that is string literal, i.e., the body is not SQL-standard function body. Routines with a SQL-standard body are permitted starting from PostgreSQL 14. Problem detection INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View
934 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
935 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
936 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
937 The total number of physical lines of code in the bodies of user-defined SQL and PL/pgSQL functions/procedures Find a numerical measure that describes the extent of the database public interface (virtual data layer) through which users access the database. Sofware measure INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View
938 The total size of all indexes (system catalog excluded) Sofware measure system catalog base tables only 2025-11-07 10:11 MIT License View
939 The total size of all tables (system catalog excluded) Sofware measure system catalog base tables only 2025-11-07 10:11 MIT License View
940 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