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.
#1001. Referential degree of tables
INFORMATION_SCHEMA onlyThis metric represents the number of foreign keys in a base table.
#1002. Referential degree of tables (ver 2)
system catalog base tables onlyFind how many base tables are referenced from a base table by using foreign keys.
#1003. The longest names of database objects by object type
INFORMATION_SCHEMA+system catalog base tables"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 TOP 3 longest (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.
#1004. The longest referential paths
system catalog base tables onlyFind the longest referential paths between the tables regardless of the schema that contain the tables.
#1005. The number and percentage of base tables where all the non-primary key columns are optional
INFORMATION_SCHEMA onlyFind the number and percentage of base tables where all the non-primary key columns are optional
#1006. The number and percentage of base tables without CHECK constraints
INFORMATION_SCHEMA onlyFind the extent in which data integrity is checked at the database level. Find the number and percentage of base tables that do not have any associated CHECK constraints.
#1007. The number and percentage of base tables without keys
INFORMATION_SCHEMA onlyFind the extent in which repeating rows are permitted in the database. Find the number and percentage (from the total number of base tables) of base tables that do not have the PRIMARY KEY constraint and also do not have any UNIQUE constraints.
#1008. The number and percentage of different names of database objects
INFORMATION_SCHEMA+system catalog base tablesNames should be expressive. Find the number of different names used in a database as well as the number of named database objects, and the percentage of different names from all the names. Names should be expressive. Different objects should have different names. The smaller the percentage the less descriptive are the names in the database. Find the number of different names (identifiers) of user-defined database objects and compare it with the total number of database objects. The values could be used to compare different databases.
#1009. The number and percentage of different names of database objects by object type
INFORMATION_SCHEMA+system catalog base tables"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. Different objects should have different names. The smaller the percentage the less descriptive are the names in the database. Find the number of different names (identifiers) of user-defined database objects by the object type and compare it with the total number of database objects with this type. The values could be used to compare different databases.
#1010. The number and percentage of optinal columns in base tables
INFORMATION_SCHEMA onlyFind the number and percentage of optinal columns in base tables
#1011. The number of base table columns based on data type
INFORMATION_SCHEMA onlyFind the number of base table columns based on data type.
#1012. The number of base table columns by type category
INFORMATION_SCHEMA onlyFind the number of base table columns based on the category of data type that the columns have.
#1013. The number of columns based on table type
INFORMATION_SCHEMA+system catalog base tablesFind the total number of columns in the different types of tables as well as average number of columns in the tables as well as minimal and maximal number of columns.
#1014. The number of commented routines
INFORMATION_SCHEMA+system catalog base tablesFind the number of commented routines based on the way how the comments have been added (as a COMMENT object or as a comment in the routine body).
#1015. The number of compensating actions of foreign key constraints
system catalog base tables onlyFind the number of compensating actions that are specified in case of foreign key constraints.
#1016. The number of constraints by schema, by type, and in total
INFORMATION_SCHEMA+system catalog base tablesFind the number of constraints in different schemas. The number of constraints in a database gives an indication about the state of enforcing constraints at the database level.
#1017. The number of default values
INFORMATION_SCHEMA onlyFind the total number of columns with a default value as well as the number of columns with different kinds of default values (the number of columns where the default is used to implement surrogate key, the number of columns where the default is not used to implement surrogate key, the number of columns with a static default value, the number of columns with a dynamic default value).
#1018. The number of derived table columns with an array, a user-defined, XML, JSON, or JSONB type
INFORMATION_SCHEMA+system catalog base tablesFind the number of derived table columns with json, xml, array, or user-defined types. Such columns may contain data that has been aggregated/composed based on values in base tables.
#1019. The number of direct and indirect child tables (foreign keys)
system catalog base tables onlyFind the number of direct and all (direct+indirect) child tables of a base table based on the foreign keys. The result may help to classify the data. If the number of direct children is small but the number of all children is large, then the table probably contains classifiers. If both the number of direct and all children is large, then the table probably contains master data. If the number of all children is small, then the table probably contains transactional data, logs, or descriptive information of main entities.
#1020. The number of direct and indirect child tables (table inheritance)
system catalog base tables onlyFind the number of direct and all (direct+indirect) child tables of a base table based on the table inheritance.
| # | Name | Goal | Type (sorted ascending) | Data source | Last update | License | Actions |
|---|---|---|---|---|---|---|---|
| 1001 | Referential degree of tables | This metric represents the number of foreign keys in a base table. | Sofware measure | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 1002 | Referential degree of tables (ver 2) | Find how many base tables are referenced from a base table by using foreign keys. | Sofware measure | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 1003 | The longest 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 TOP 3 longest (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. | Sofware measure | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 1004 | The longest referential paths | Find the longest referential paths between the tables regardless of the schema that contain the tables. | Sofware measure | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 1005 | The number and percentage of base tables where all the non-primary key columns are optional | Find the number and percentage of base tables where all the non-primary key columns are optional | Sofware measure | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 1006 | The number and percentage of base tables without CHECK constraints | Find the extent in which data integrity is checked at the database level. Find the number and percentage of base tables that do not have any associated CHECK constraints. | Sofware measure | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 1007 | The number and percentage of base tables without keys | Find the extent in which repeating rows are permitted in the database. Find the number and percentage (from the total number of base tables) of base tables that do not have the PRIMARY KEY constraint and also do not have any UNIQUE constraints. | Sofware measure | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 1008 | The number and percentage of different names of database objects | Names should be expressive. Find the number of different names used in a database as well as the number of named database objects, and the percentage of different names from all the names. Names should be expressive. Different objects should have different names. The smaller the percentage the less descriptive are the names in the database. Find the number of different names (identifiers) of user-defined database objects and compare it with the total number of database objects. The values could be used to compare different databases. | Sofware measure | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 1009 | The number and percentage of different 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. Different objects should have different names. The smaller the percentage the less descriptive are the names in the database. Find the number of different names (identifiers) of user-defined database objects by the object type and compare it with the total number of database objects with this type. The values could be used to compare different databases. | Sofware measure | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 1010 | The number and percentage of optinal columns in base tables | Find the number and percentage of optinal columns in base tables | Sofware measure | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 1011 | The number of base table columns based on data type | Find the number of base table columns based on data type. | Sofware measure | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 1012 | The number of base table columns by type category | Find the number of base table columns based on the category of data type that the columns have. | Sofware measure | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 1013 | The number of columns based on table type | Find the total number of columns in the different types of tables as well as average number of columns in the tables as well as minimal and maximal number of columns. | Sofware measure | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 1014 | The number of commented routines | Find the number of commented routines based on the way how the comments have been added (as a COMMENT object or as a comment in the routine body). | Sofware measure | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 1015 | The number of compensating actions of foreign key constraints | Find the number of compensating actions that are specified in case of foreign key constraints. | Sofware measure | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 1016 | The number of constraints by schema, by type, and in total | Find the number of constraints in different schemas. The number of constraints in a database gives an indication about the state of enforcing constraints at the database level. | Sofware measure | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 1017 | The number of default values | Find the total number of columns with a default value as well as the number of columns with different kinds of default values (the number of columns where the default is used to implement surrogate key, the number of columns where the default is not used to implement surrogate key, the number of columns with a static default value, the number of columns with a dynamic default value). | Sofware measure | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 1018 | The number of derived table columns with an array, a user-defined, XML, JSON, or JSONB type | Find the number of derived table columns with json, xml, array, or user-defined types. Such columns may contain data that has been aggregated/composed based on values in base tables. | Sofware measure | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 1019 | The number of direct and indirect child tables (foreign keys) | Find the number of direct and all (direct+indirect) child tables of a base table based on the foreign keys. The result may help to classify the data. If the number of direct children is small but the number of all children is large, then the table probably contains classifiers. If both the number of direct and all children is large, then the table probably contains master data. If the number of all children is small, then the table probably contains transactional data, logs, or descriptive information of main entities. | Sofware measure | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 1020 | The number of direct and indirect child tables (table inheritance) | Find the number of direct and all (direct+indirect) child tables of a base table based on the table inheritance. | Sofware measure | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) |