Filter Queries

Found 1073 queries.

Page 23 of 54
  • 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.

#441. Deferrable foreign key constraint with a RESTRICT compensating action

system catalog base tables only

Find deferrable foreign key constraint with ON UPDATE RESTRICT or ON DELETE RESTRICT compensating action. Referential actions are carried out before, and are not part of, the checking of a referential constraint. Deferring a referential constraint defers the checking of the of the constraint (a ) but does not defer the referential actions of the referential constraint. In PostgreSQL the essential difference between NO ACTION and RESTRICT is that NO ACTION allows the check to be deferred until later in the transaction, whereas RESTRICT does not. Thus RESTRICT could result with the failure of data modification where in case of NO ACTION the modification would succeed.

Problem detection License: MIT (opens in new tab)

#442. Definition of a non-minimal superkey instead of a candidate key (based on check constraints)

INFORMATION_SCHEMA+system catalog base tables

Candidate key is a minimal superkey, meaning that it is not possible to remove columns from the candidate key without losing its uniqueness property. One should define primary key's and unique constraints based on candidate keys. Find primary key and unique constraints where a proper subset of columns has a check constraint that permits only one value in the column. The candidate key should involve only columns without such constraint.

Problem detection License: MIT (opens in new tab)

#443. Definition of a non-minimal superkey instead of a candidate key (based on enumeration types)

INFORMATION_SCHEMA+system catalog base tables

Candidate key is a minimal superkey, meaning that it is not possible to remove columns from the candidate key without losing its uniqueness property. One should define primary key's and unique constraints based on candidate keys. Find primary key and unique constraints where a proper subset of columns has an enumeration type that permits only one value in the column. The candidate key should involve only columns without such type.

Problem detection License: MIT (opens in new tab)

#444. Definition of a non-minimal superkey instead of a candidate key (based on key constraints)

system catalog base tables only

Find primary key, unique constraints, and exclude constraints wiht only operator = (i.e., sets of columns) that are proper subsets of other primary key, unique, and exclude constraints of the same table. Candidate key is a minimal superkey, meaning that it is not possible to remove columns from the candidate key without losing its uniqueness property. One should define primary key's and unique constraints based on candidate keys, i.e., the keys should not have redundancy in terms of columns.

Problem detection License: MIT (opens in new tab)

#445. Definition of a non-minimal superkey instead of a candidate key (based on sequence generators)

INFORMATION_SCHEMA+system catalog base tables

Candidate key is a minimal superkey, meaning that it is not possible to remove columns from the candidate key without losing its uniqueness property. One should define primary key's and unique constraints based on candidate keys. Find primary keys and unique constraints where a proper subset of the key is a column with an associated sequence generator. Most certainly such subset contains unique values. Thus, this subset should be the key, not its superset.

Problem detection License: MIT (opens in new tab)

#446. Definition of a non-minimal superkey instead of a candidate key (based on unique indexes)

system catalog base tables only

Find pairs of non-partial unique indexes where the columns of a index are a proper subset of the columns of another index. Include indexes that support a constraint (primary key, unique, exclude), i.e., these indexes have been automatically created due to the constraint declaration. Exclude the pairs where both participants have been created to support a constraint. Candidate key is a minimal superkey, meaning that it is not possible to remove columns from the candidate key without losing its uniqueness property. One should define keys based on candidate keys, i.e., the keys should not have redundancy in terms of columns. Defining a unique index essentially means defining a key in the table but it is done at the lower level of abstraction.

Problem detection License: MIT (opens in new tab)

#447. Delimited identifiers

INFORMATION_SCHEMA+system catalog base tables

Delimited identifiers (quoted identifiers) are case sensitive. Identifiers of database objects should be case insensitive in order to simplify their management.

Problem detection License: MIT (opens in new tab)

#448. Depth of referential tree of a schema

system catalog base tables only

Depth of referential tree of a database schema is the longest referential path between the tables in this schema (Piattini et al., 2001). In other words, it is the biggest value among the DRT(T) values of all the tables of the schema.

Sofware measure License: MIT (opens in new tab)

#449. Depth of relational tree of a table

system catalog base tables only

Depth of relational tree of a table T (DRT(T)) is defined by Piattini et al. (2001) as "the longest referential path between tables, from the table T to any other table in the schema". The result may help to classify the data. If the depth is 0, then probably the table contains classifers. Tables with the largest depth probably contain some extra information about main entities.

Sofware measure License: MIT (opens in new tab)

#450. Derived table on top of another derived table

INFORMATION_SCHEMA+system catalog base tables

Do not build multiple levels of derived tables (views and materialized views) because it will hamper evolvability and understandability of the tables.

Problem detection License: MIT (opens in new tab)

#451. Derived table presents the same data in the same way as a single base table

INFORMATION_SCHEMA+system catalog base tables

Find derived tables (views and materialized views) that present data from one base table without adding columns, renaming columns, changing the order of columns, removing columns, or restricting rows. Perhaps something is missing from the subquery of the derived table.

Problem detection License: MIT (opens in new tab)

#452. Derived tables that have a column with the xid type

INFORMATION_SCHEMA+system catalog base tables

Find the derived tables (views and materialized views) that have a column with the xid type, i.e., these use the data from the hidden xmin column of a base table. If one uses optimistic approach for dealing with the concurrent data modifications, then xmin values should be presented by views and used in routines that modify or delete rows.

General License: MIT (opens in new tab)

#453. Derived tables that present data in json or xml format

INFORMATION_SCHEMA+system catalog base tables

Find views and materialized views that present data in json or xml format. Instead of recording data in this format in base tables one could generate the data value on the fly based on data that has been recorded in base tables.

General License: MIT (opens in new tab)

#454. Derived tables with multiple DISTINCT's

INFORMATION_SCHEMA+system catalog base tables

Find derived tables (views and materialized views) that contain more than one DISTINCT invocation. Make sure that the query is correctly written, including that it does not have unwanted formation of a Cartesian product.

General License: MIT (opens in new tab)

#455. Derived tables with ranking

INFORMATION_SCHEMA+system catalog base tables

Find views and materialized views that use rank and dense_rank window functions.

General License: MIT (opens in new tab)

#456. Derived tables with sorting

INFORMATION_SCHEMA+system catalog base tables

Find derived tables where the rows are ordered, i.e., there is ORDER BY clause at the end of the view. Different users may want to see the rows in different order. Thus, the DBMS may have to do extra and unnecessary work by firstly sorting based on one set of rows and after that based on other set of rows. Use sorting if you know that all the users want the rows in the same order and cannot/will not change the order in the application.

General License: MIT (opens in new tab)

#457. Derived tables with string_agg

INFORMATION_SCHEMA+system catalog base tables

Find views and materialized views that use string_agg aggregate function.

General License: MIT (opens in new tab)

#458. Derived table uses a function to get data from another table

INFORMATION_SCHEMA+system catalog base tables

Find views that use a function to get data from another table.

Problem detection License: MIT (opens in new tab)

#459. Deterministic (immutable) functions that do not have input parameters

INFORMATION_SCHEMA+system catalog base tables

Find deterministic functions that do not have any input parameters. Make sure that it is correct because in general a deterministic function must calculate a value based on input.

Problem detection License: MIT (opens in new tab)

#460. Deterministic (immutable) functions that do not return a value

INFORMATION_SCHEMA+system catalog base tables

Find deterministic (immutable) functions that do not return a value. This goes against the idea of deterministic functions.

Problem detection License: MIT (opens in new tab)
# 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
441 Deferrable foreign key constraint with a RESTRICT compensating action Find deferrable foreign key constraint with ON UPDATE RESTRICT or ON DELETE RESTRICT compensating action. Referential actions are carried out before, and are not part of, the checking of a referential constraint. Deferring a referential constraint defers the checking of the of the constraint (a ) but does not defer the referential actions of the referential constraint. In PostgreSQL the essential difference between NO ACTION and RESTRICT is that NO ACTION allows the check to be deferred until later in the transaction, whereas RESTRICT does not. Thus RESTRICT could result with the failure of data modification where in case of NO ACTION the modification would succeed. Problem detection system catalog base tables only MIT (opens in new tab) View
442 Definition of a non-minimal superkey instead of a candidate key (based on check constraints) Candidate key is a minimal superkey, meaning that it is not possible to remove columns from the candidate key without losing its uniqueness property. One should define primary key's and unique constraints based on candidate keys. Find primary key and unique constraints where a proper subset of columns has a check constraint that permits only one value in the column. The candidate key should involve only columns without such constraint. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View
443 Definition of a non-minimal superkey instead of a candidate key (based on enumeration types) Candidate key is a minimal superkey, meaning that it is not possible to remove columns from the candidate key without losing its uniqueness property. One should define primary key's and unique constraints based on candidate keys. Find primary key and unique constraints where a proper subset of columns has an enumeration type that permits only one value in the column. The candidate key should involve only columns without such type. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View
444 Definition of a non-minimal superkey instead of a candidate key (based on key constraints) Find primary key, unique constraints, and exclude constraints wiht only operator = (i.e., sets of columns) that are proper subsets of other primary key, unique, and exclude constraints of the same table. Candidate key is a minimal superkey, meaning that it is not possible to remove columns from the candidate key without losing its uniqueness property. One should define primary key's and unique constraints based on candidate keys, i.e., the keys should not have redundancy in terms of columns. Problem detection system catalog base tables only MIT (opens in new tab) View
445 Definition of a non-minimal superkey instead of a candidate key (based on sequence generators) Candidate key is a minimal superkey, meaning that it is not possible to remove columns from the candidate key without losing its uniqueness property. One should define primary key's and unique constraints based on candidate keys. Find primary keys and unique constraints where a proper subset of the key is a column with an associated sequence generator. Most certainly such subset contains unique values. Thus, this subset should be the key, not its superset. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View
446 Definition of a non-minimal superkey instead of a candidate key (based on unique indexes) Find pairs of non-partial unique indexes where the columns of a index are a proper subset of the columns of another index. Include indexes that support a constraint (primary key, unique, exclude), i.e., these indexes have been automatically created due to the constraint declaration. Exclude the pairs where both participants have been created to support a constraint. Candidate key is a minimal superkey, meaning that it is not possible to remove columns from the candidate key without losing its uniqueness property. One should define keys based on candidate keys, i.e., the keys should not have redundancy in terms of columns. Defining a unique index essentially means defining a key in the table but it is done at the lower level of abstraction. Problem detection system catalog base tables only MIT (opens in new tab) View
447 Delimited identifiers Delimited identifiers (quoted identifiers) are case sensitive. Identifiers of database objects should be case insensitive in order to simplify their management. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View
448 Depth of referential tree of a schema Depth of referential tree of a database schema is the longest referential path between the tables in this schema (Piattini et al., 2001). In other words, it is the biggest value among the DRT(T) values of all the tables of the schema. Sofware measure system catalog base tables only MIT (opens in new tab) View
449 Depth of relational tree of a table Depth of relational tree of a table T (DRT(T)) is defined by Piattini et al. (2001) as "the longest referential path between tables, from the table T to any other table in the schema". The result may help to classify the data. If the depth is 0, then probably the table contains classifers. Tables with the largest depth probably contain some extra information about main entities. Sofware measure system catalog base tables only MIT (opens in new tab) View
450 Derived table on top of another derived table Do not build multiple levels of derived tables (views and materialized views) because it will hamper evolvability and understandability of the tables. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View
451 Derived table presents the same data in the same way as a single base table Find derived tables (views and materialized views) that present data from one base table without adding columns, renaming columns, changing the order of columns, removing columns, or restricting rows. Perhaps something is missing from the subquery of the derived table. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View
452 Derived tables that have a column with the xid type Find the derived tables (views and materialized views) that have a column with the xid type, i.e., these use the data from the hidden xmin column of a base table. If one uses optimistic approach for dealing with the concurrent data modifications, then xmin values should be presented by views and used in routines that modify or delete rows. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View
453 Derived tables that present data in json or xml format Find views and materialized views that present data in json or xml format. Instead of recording data in this format in base tables one could generate the data value on the fly based on data that has been recorded in base tables. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View
454 Derived tables with multiple DISTINCT's Find derived tables (views and materialized views) that contain more than one DISTINCT invocation. Make sure that the query is correctly written, including that it does not have unwanted formation of a Cartesian product. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View
455 Derived tables with ranking Find views and materialized views that use rank and dense_rank window functions. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View
456 Derived tables with sorting Find derived tables where the rows are ordered, i.e., there is ORDER BY clause at the end of the view. Different users may want to see the rows in different order. Thus, the DBMS may have to do extra and unnecessary work by firstly sorting based on one set of rows and after that based on other set of rows. Use sorting if you know that all the users want the rows in the same order and cannot/will not change the order in the application. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View
457 Derived tables with string_agg Find views and materialized views that use string_agg aggregate function. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View
458 Derived table uses a function to get data from another table Find views that use a function to get data from another table. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View
459 Deterministic (immutable) functions that do not have input parameters Find deterministic functions that do not have any input parameters. Make sure that it is correct because in general a deterministic function must calculate a value based on input. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View
460 Deterministic (immutable) functions that do not return a value Find deterministic (immutable) functions that do not return a value. This goes against the idea of deterministic functions. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View