| Goal | Find composite indexes that do not support any constraint but are on more than three columns. |
|---|---|
| Notes | The query does not count any included columns, which are merely stored and do not participate in the index semantics. According to the PostgreSQL documentation: "Multicolumn indexes should be used sparingly. In most situations, an index on a single column is sufficient and saves space and time. Indexes with more than three columns are unlikely to be helpful unless the usage of the table is extremely stylized." |
| Type | Problem detection Each row in the result could represent a flaw in the design |
| Reliability | Low Many false-positive results |
| License | MIT (opens in new tab) |
| Data Source | system catalog only |
| SQL Query |
|
Collections
This query belongs to the following collections:
Find problems automatically
Queries, that results point to problems in the database. Each query in the collection produces an initial assessment. However, a human reviewer has the final say as to whether there is a problem or not .
| Name | Description |
|---|---|
| Find problems automatically | Queries, that results point to problems in the database. Each query in the collection produces an initial assessment. However, a human reviewer has the final say as to whether there is a problem or not . |
Categories
This query is classified under the following categories:
Performance
Queries of this category provide information about indexes in a database.
| Name | Description |
|---|---|
| Performance | Queries of this category provide information about indexes in a database. |
Further reading and related materials: