What Are Indexes?

Indexes are database objects that improve the speed of data retrieval. They are automatically used by the optimizer when needed.

Common use cases:

  • Speeding up searches on large tables
  • Supporting primary and unique key constraints
CREATE INDEX emp_name_idx ON employees(last_name);