Filter Queries
Found 1056 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 the relatively small amount of data in the system catalog of a database.
#501. Empty columns
INFORMATION_SCHEMA+system catalog base tablesFind columns in non-empty tables that do not contain any values. If there are no values in a columns, then it may mean that one hasn't tested constraints that have been declared to the column or implemented by using triggers. It could also mean that such columns are not needed at all.
#502. Empty tables
system catalog base tables onlyFind base tables where the number of rows is zero. If there are no rows in a table, then it may mean that one hasn't tested constraints that have been declared to the table or implemented by using triggers. It could also mean that the table is not needed because there is no data that should be registered in the table.
#503. Enumerated types with zero or one value
INFORMATION_SCHEMA+system catalog base tablesFidn enumerated types with zero or one value. Type is a named finite set of values. The empty set is a set. A set with one value is a set. Thus, types with zero or one value are legal. In practical terms each type, usually, should contain at least two values.
#504. Excessive privileges on databases, schemas, domains, types, languages, foreign data wrappers, and foreign servers
system catalog base tables onlyFind excessive privileges on databases, schemas, domains, collations, sequences, foreign data wrappers, and foreign servers that are probably not needed by a typical application.
#505. Exclude constraint instead of simple UNIQUE
system catalog base tables onlyFind exclude constraints that implement a simple UNIQUE constraint. The checking might be slower compared to UNIQUE constraint.
#506. Exclude constraint to prevent overlapping time periods
INFORMATION_SCHEMA+system catalog base tablesFind exclude constraints on base tables with multiple date/timestamp columns that prevent overlapping time periods.
#507. Extension routines
system catalog base tables onlyFind all routines that belong to an extension.
#508. Extension routines in the schema "public"
system catalog base tables onlyFind extensions that routines are in the schema public.
#509. Extension routines that execution privilege has been granted to PUBLIC
INFORMATION_SCHEMA+system catalog base tablesKnow the privileges that users have in your system. Probably all the database users do not need these privileges.
#510. Extensions that are available but are not installed
system catalog base tables onlyTry to use as much the possibilities of the DBMS as possible. On the other hand, do not install extensions that are not needed in order not to overcomplicate the database.
#511. Extreme contraction
INFORMATION_SCHEMA+system catalog base tablesFind names that contain extremely short terms, due to an excessive word contraction, abbreviation, or acronym usage.
#512. Field size is not sufficiently different in case of base table columns
INFORMATION_SCHEMA onlyFind base table columns that name refers to the possibility that these are used to register names. Find base table columns that name refers to the possibility that these are used to register comments/descriptions/etc. Find the cases where a base table contains columns from the both sets and the field size in case of the latter is not at least twice as big as in case of the former. For example, if the name of a service can be 100 character long, then it is quite illogical that the description of the service is only at most 200 characters long.
#513. Find all non-foreign key columns of base tables
INFORMATION_SCHEMA+system catalog base tablesFind all non-foreign key columns of base tables. Make sure that no foreign key constraint is missing.
#514. Find all publications
INFORMATION_SCHEMA+system catalog base tablesFind publications of tables that have been created in order to enable logical replication.
#515. Flag parameters
INFORMATION_SCHEMA+system catalog base tablesA Boolean parameter may be used to determine what task to fulfill. In this case the routine has multiple tasks and does not satisfy the separation of concerns principle.
#516. Foreign key column has a default value that is not present in the parent table
INFORMATION_SCHEMA+system catalog base tablesFind foreign key columns that have a default value that is not present in the parent table. Identify default values that cause violations of the referential constraints.
#517. Foreign key column has a simple check constraint that is attached directly to the table
system catalog base tables onlyFind foreign key columns that are covered by a simple check constraint, i.e., the constraint involves only one column. Look only constraints that are directly associated with the table, i.e., are not specified through a domain. Perhaps the constraint should be defined on the referenced candidate key column.
#518. Foreign key columns that are associated with a sequence generator
INFORMATION_SCHEMA+system catalog base tablesFind foreign key columns that are associated with a sequence generator. Foreign key values are selected amongst the values that are registered as corresponding primary key/unique key values. Values in the foreign key columns are not directly generated by the system. These values might be system generated indirectly - generated when a row is added to the primary (parent) table.
#519. Foreign key columns that do not have an integer or varchar type
INFORMATION_SCHEMA+system catalog base tablesFind foreign key columns that do not have smallint, integer, bigint, or varchar(n) type. These are the most commonly used types in case of key/foreign key columns. Although the use of other types would be perfectly legal as well, make sure that you have selected the best possible data type for each and every column.
#520. Foreign key columns that have no index
INFORMATION_SCHEMA+system catalog base tablesFind foreign key columns that do not have an index. Foreign key columns are often used for performing join operations. It is useful to index such columns.
| # | Name(activate to sort ascending) | Goal(activate to sort ascending) | Type(activate to sort ascending) | Data source(activate to sort ascending) | Last update(sorted descending, activate to sort ascending) | License | Actions |
|---|---|---|---|---|---|---|---|
| 501 | Empty columns | Find columns in non-empty tables that do not contain any values. If there are no values in a columns, then it may mean that one hasn't tested constraints that have been declared to the column or implemented by using triggers. It could also mean that such columns are not needed at all. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 502 | Empty tables | Find base tables where the number of rows is zero. If there are no rows in a table, then it may mean that one hasn't tested constraints that have been declared to the table or implemented by using triggers. It could also mean that the table is not needed because there is no data that should be registered in the table. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 503 | Enumerated types with zero or one value | Fidn enumerated types with zero or one value. Type is a named finite set of values. The empty set is a set. A set with one value is a set. Thus, types with zero or one value are legal. In practical terms each type, usually, should contain at least two values. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 504 | Excessive privileges on databases, schemas, domains, types, languages, foreign data wrappers, and foreign servers | Find excessive privileges on databases, schemas, domains, collations, sequences, foreign data wrappers, and foreign servers that are probably not needed by a typical application. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 505 | Exclude constraint instead of simple UNIQUE | Find exclude constraints that implement a simple UNIQUE constraint. The checking might be slower compared to UNIQUE constraint. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 506 | Exclude constraint to prevent overlapping time periods | Find exclude constraints on base tables with multiple date/timestamp columns that prevent overlapping time periods. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 507 | Extension routines | Find all routines that belong to an extension. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 508 | Extension routines in the schema "public" | Find extensions that routines are in the schema public. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 509 | Extension routines that execution privilege has been granted to PUBLIC | Know the privileges that users have in your system. Probably all the database users do not need these privileges. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 510 | Extensions that are available but are not installed | Try to use as much the possibilities of the DBMS as possible. On the other hand, do not install extensions that are not needed in order not to overcomplicate the database. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 511 | Extreme contraction | Find names that contain extremely short terms, due to an excessive word contraction, abbreviation, or acronym usage. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 512 | Field size is not sufficiently different in case of base table columns | Find base table columns that name refers to the possibility that these are used to register names. Find base table columns that name refers to the possibility that these are used to register comments/descriptions/etc. Find the cases where a base table contains columns from the both sets and the field size in case of the latter is not at least twice as big as in case of the former. For example, if the name of a service can be 100 character long, then it is quite illogical that the description of the service is only at most 200 characters long. | Problem detection | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 513 | Find all non-foreign key columns of base tables | Find all non-foreign key columns of base tables. Make sure that no foreign key constraint is missing. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 514 | Find all publications | Find publications of tables that have been created in order to enable logical replication. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 515 | Flag parameters | A Boolean parameter may be used to determine what task to fulfill. In this case the routine has multiple tasks and does not satisfy the separation of concerns principle. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 516 | Foreign key column has a default value that is not present in the parent table | Find foreign key columns that have a default value that is not present in the parent table. Identify default values that cause violations of the referential constraints. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 517 | Foreign key column has a simple check constraint that is attached directly to the table | Find foreign key columns that are covered by a simple check constraint, i.e., the constraint involves only one column. Look only constraints that are directly associated with the table, i.e., are not specified through a domain. Perhaps the constraint should be defined on the referenced candidate key column. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 518 | Foreign key columns that are associated with a sequence generator | Find foreign key columns that are associated with a sequence generator. Foreign key values are selected amongst the values that are registered as corresponding primary key/unique key values. Values in the foreign key columns are not directly generated by the system. These values might be system generated indirectly - generated when a row is added to the primary (parent) table. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 519 | Foreign key columns that do not have an integer or varchar type | Find foreign key columns that do not have smallint, integer, bigint, or varchar(n) type. These are the most commonly used types in case of key/foreign key columns. Although the use of other types would be perfectly legal as well, make sure that you have selected the best possible data type for each and every column. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 520 | Foreign key columns that have no index | Find foreign key columns that do not have an index. Foreign key columns are often used for performing join operations. It is useful to index such columns. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) |