SQL · Pattern 14 — Database Design & Performance
Indexes
An index improves query performance by allowing the database engine to locate rows more efficiently.
Source data — Pattern 14: Database Design & Performance
All queries run against the shared employees table (see schema.sql). This pattern introduces performance optimization and transaction management. Topic 85 introduces an accounts table to demonstrate COMMIT and ROLLBACK using a money transfer transaction.


What it does
An index improves query performance by allowing the database engine to locate rows more efficiently.
Problem
Create an index to optimize employee email searches.
CREATE INDEX idx_employee_email
ON employees(email);
Result
