sql / beginner
Snippet
Accelerating Data Lookups by Creating Indexes with CREATE INDEX
Creating an index on a table column allows the database engine to locate records faster during search queries without scanning every row in the table. This significantly enhances lookup performance on heavily queried fields like email addresses.
snippet.sql
sql
1
CREATE INDEX idx_employee_email ON employees (email);
Breakdown
1
CREATE INDEX idx_employee_email ON employees (email);
Creates a lookup index named idx_employee_email on the email column of the employees table.