How do I see whether a query uses an index in PostgreSQL?
Run `EXPLAIN ANALYZE` before the query. If the plan shows an “Index Scan” or “Index Only Scan” on the relevant index, it is being used; a “Seq Scan” on a large table usually means the index is missing, not selective enough, or the query prevents its use (e.g. a function on the column).