Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Indexes on expressions
5. When indexes on expressions are used
Partial indexes
Clustered indexes
Summary

Instruction

Great! In the previous instruction, we indexed an expression like this:

CREATE INDEX company_insensitive
ON dev_award (LOWER(company));

This index will only be used in queries where the function call LOWER(company) appears, for example:

SELECT
  first_name,
  last_name
FROM dev_award
WHERE LOWER(company) = 'vertabelo';

The index won't be used in the following situation:

SELECT
  first_name,
  last_name
FROM dev_award
WHERE company = 'Vertabelo';

In this case, you'd have to create a separate index on the column company without the LOWER() function.

Exercise

Click Next exercise to continue.