INCLUDE INDEX (Covering Index)
INCLUDE INDEX (Covering Index) is a SQL statement in the Indexes category. An index that includes non-key columns for covering queries. SQL Server and PostgreSQL 11+. The syntax is CREATE INDEX idx_name ON table (key_cols) INCLUDE (non_key_cols);. It returns covering index. A typical example: CREATE INDEX idx_emp_dept ON employees (dept_id) INCLUDE (name, salary); -- The index can answer queries without touching the table: SELECT name, salary FROM employees WHERE dept_id = 5; -- All needed data is in the index itself A close relative is CREATE INDEX, which creates an index on one or more columns to speed up query performance. A close relative is DROP INDEX, which removes an existing index from a table. A close relative is COMPOSITE INDEX, which an index on multiple columns. Column order matters — queries use leftmost prefix. More about this category: Database indexes — CREATE INDEX, UNIQUE INDEX, COMPOSITE INDEX, DROP INDEX.