View pg_missing_indexes
Creates a view to get the information about indexes, that have not been used by now.
Columns
| Column Name | datatype | Description |
|---|---|---|
| schema_name | name | The name of the schema. |
| table_name | name | The name of the table. |
| sequential_scans | bigint | Number of sequential scans on this table. |
| last_sequential_scans | timestamp with time zone | Last time of a sequential scan on this table. Only exists in PostgreSQL >= 16 |
Example
SELECT *
FROM pg_missing_indexes;
Result:
| schema_name | table_name | sequential_scans | last_sequential_scans |
|---|---|---|---|
| cron | job | 1 | 2025-08-27 08:30:00.256 +0200 |
| cron | job_run_details | 1 | 2025-08-27 08:30:00.256 +0200 |