Filter Queries
Found 1053 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.
#701. Number of columns covered with constraints
INFORMATION_SCHEMA+system catalog base tablesFor different types of constraints find the number of columns covered with constraints of such type.
#702. Input parameters that names do not follow the convention to start with _ or p_
INFORMATION_SCHEMA+system catalog base tablesFor the sake of making code better understandable follow naming conventions.
#703. Names of database objects that are fully uppercase
INFORMATION_SCHEMA+system catalog base tablesFull uppercase means screaming and it makes comprehending the names more difficult. Find the names (identifiers) of user-defined database objects that are fully uppercase. Because PostgreSQL stores regular identifiers lowercase in the system catalog it also means that these are delimited identifiers, i.e., these are case sensitive.
#704. Percentage of the total index storage size from the total database storage size (system catalog included)
system catalog base tables onlyGet overview of disk usage.
#705. The storage size of each index (the system catalog excluded)
system catalog base tables onlyGet overview of disk usage.
#706. The storage size of each table (including indexes) (the system catalog excluded)
system catalog base tables onlyGet overview of disk usage.
#707. The total storage size of all indexes (the system catalog excluded)
system catalog base tables onlyGet overview of disk usage.
#708. The total storage size of the database (the system catalog included)
system catalog base tables onlyGet overview of disk usage.
#709. The storage size of each schema data object (the system catalog excluded)
system catalog base tables onlyGet overview of disk usage by different schema objects that contain user data.
#710. Data type usage in the base table columns
INFORMATION_SCHEMA onlyGet overview of used data types in the columns of base tables. If the selection is very small then this is a warning sign that perhaps unsuitable types have been used.
#711. Disabled rules
system catalog base tables onlyIdentify disabled rules. These should be enabled or dropped, otherwise these are dead code.
#712. Disabled user triggers
system catalog base tables onlyIdentify disabled triggers. These should be enabled or dropped, otherwise these are dead code.
#713. Base tables and foreign tables that do not have any CHECK constraints on non-foreign key columns
INFORMATION_SCHEMA+system catalog base tablesIdentify possibly missing CHECK constraints.
#714. The number of domains by schema and in total
INFORMATION_SCHEMA onlyIdentify the number of domains in different schemas.
#715. The number of sequence generators in different schemas
INFORMATION_SCHEMA onlyIdentify the number of sequence generators in different schemas. Surrogate key values must be generated by using the system (the sequence generator mechanism in case of PostgreSQL). If there are no sequence generators, then there is a question as to whether there are no surrogate keys in the database at all (could be possible and OK) or (more probable) developers have forgotten to implement the generation of surrogate keys at the database level. An alternative is to implement generation of unique values at the application level or at the database level by using triggers. However, such implementation would most probably lead to the performance penalty because adding new rows to the table must be serialized, i.e., it can be done in one session at a time.
#716. Missing USAGE privileges on schema
INFORMATION_SCHEMA+system catalog base tablesIf 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.
#717. Potentially missing PRIMARY KEY or UNIQUE constraints (based on UUIDs)
INFORMATION_SCHEMA+system catalog base tablesIf something has to be unique, then it must be said to the system so that it could use the information for internal optimizations and enforce the constraint. Find columns that contain Universally Unique Identifiers but are not a part of any simple PRIMARY KEY/UNIQUE constraint and are also not part of a foreign key.
#718. Incorrect prefix of a constraint name or an index name
INFORMATION_SCHEMA+system catalog base tablesIf the name of an object has the prefix that refers to the type of the object (for instance, primary key constraint or foreign key constraint), then you should use references to the correct object type. Find prefixes of constraint names and index names that incorrectly refer to the type of the object. For instance, incorrect would be to use chk_ as the prefix of an index name or pk_ as the prefix of a check constraint name.
#719. Incorrect suffix of a constraint name or an index name
INFORMATION_SCHEMA+system catalog base tablesIf the name of an object has the suffix that refers to the type of the object (for instance, primary key constraint or foreign key constraint), then you should use references to the correct object type. Find suffixes of constraint names and index names that incorrectly refer to the type of the object. For instance, incorrect would be to use _chk as the suffix of an index name or _pk as the suffix of a check constraint name.
#720. Parameter name is the same as the name of a used column
INFORMATION_SCHEMA+system catalog base tablesIf the name of a routine parameter and the name of a column of a table that is used in the routine are the same, then it makes it more difficult to understand the code.
| # | Name | Goal (sorted ascending) | Type | Data source | Last update | License | Actions |
|---|---|---|---|---|---|---|---|
| 701 | Number of columns covered with constraints | For different types of constraints find the number of columns covered with constraints of such type. | Sofware measure | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 702 | Input parameters that names do not follow the convention to start with _ or p_ | For the sake of making code better understandable follow naming conventions. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 703 | Names of database objects that are fully uppercase | Full uppercase means screaming and it makes comprehending the names more difficult. Find the names (identifiers) of user-defined database objects that are fully uppercase. Because PostgreSQL stores regular identifiers lowercase in the system catalog it also means that these are delimited identifiers, i.e., these are case sensitive. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 704 | Percentage of the total index storage size from the total database storage size (system catalog included) | Get overview of disk usage. | Sofware measure | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 705 | The storage size of each index (the system catalog excluded) | Get overview of disk usage. | Sofware measure | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 706 | The storage size of each table (including indexes) (the system catalog excluded) | Get overview of disk usage. | Sofware measure | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 707 | The total storage size of all indexes (the system catalog excluded) | Get overview of disk usage. | Sofware measure | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 708 | The total storage size of the database (the system catalog included) | Get overview of disk usage. | Sofware measure | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 709 | 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 | MIT (opens in new tab) | View (opens in new tab) | |
| 710 | Data type usage in the base table columns | Get overview of used data types in the columns of base tables. If the selection is very small then this is a warning sign that perhaps unsuitable types have been used. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 711 | Disabled rules | Identify disabled rules. These should be enabled or dropped, otherwise these are dead code. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 712 | Disabled user triggers | Identify disabled triggers. These should be enabled or dropped, otherwise these are dead code. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 713 | Base tables and foreign tables that do not have any CHECK constraints on non-foreign key columns | Identify possibly missing CHECK constraints. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 714 | The number of domains by schema and in total | Identify the number of domains in different schemas. | Sofware measure | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 715 | The number of sequence generators in different schemas | Identify the number of sequence generators in different schemas. Surrogate key values must be generated by using the system (the sequence generator mechanism in case of PostgreSQL). If there are no sequence generators, then there is a question as to whether there are no surrogate keys in the database at all (could be possible and OK) or (more probable) developers have forgotten to implement the generation of surrogate keys at the database level. An alternative is to implement generation of unique values at the application level or at the database level by using triggers. However, such implementation would most probably lead to the performance penalty because adding new rows to the table must be serialized, i.e., it can be done in one session at a time. | Sofware measure | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 716 | Missing USAGE privileges on schema | If 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 detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 717 | Potentially missing PRIMARY KEY or UNIQUE constraints (based on UUIDs) | If something has to be unique, then it must be said to the system so that it could use the information for internal optimizations and enforce the constraint. Find columns that contain Universally Unique Identifiers but are not a part of any simple PRIMARY KEY/UNIQUE constraint and are also not part of a foreign key. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 718 | Incorrect prefix of a constraint name or an index name | If the name of an object has the prefix that refers to the type of the object (for instance, primary key constraint or foreign key constraint), then you should use references to the correct object type. Find prefixes of constraint names and index names that incorrectly refer to the type of the object. For instance, incorrect would be to use chk_ as the prefix of an index name or pk_ as the prefix of a check constraint name. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 719 | Incorrect suffix of a constraint name or an index name | If the name of an object has the suffix that refers to the type of the object (for instance, primary key constraint or foreign key constraint), then you should use references to the correct object type. Find suffixes of constraint names and index names that incorrectly refer to the type of the object. For instance, incorrect would be to use _chk as the suffix of an index name or _pk as the suffix of a check constraint name. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 720 | Parameter name is the same as the name of a used column | If the name of a routine parameter and the name of a column of a table that is used in the routine are the same, then it makes it more difficult to understand the code. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) |