← Backend PythonQuestion 30 of 49
What is a composite index and when would you use one instead of single-column indexes?
📘 Explanation
A composite index covers multiple columns and is useful when queries filter on that same combination, following the left-prefix rule where column order matters. The other options describe unrelated ideas like storing full row data, merging separate indexes automatically, or spanning multiple tables via foreign keys.
Related questions
- What are partial indexes and functional indexes, and what problems do they solve?
- If PostgreSQL chooses a bad query plan because statistics are stale, what command should you run?
- What is the left-prefix rule for composite indexes?
- What is the difference between ANALYZE and VACUUM ANALYZE in PostgreSQL?
- Why might a query using LOWER(email) not use an index on email?
← PreviousNo login needed