\di

Category: Databases & SQL

\di

List indexes in the database

Shows every index with its table and columns; \di+ adds sizes. Indexes speed up lookups but slow down writes, so watch for duplicates. Related: \d users to see one table's indexes.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.