Database indexes

Which field is a natural index candidate?

Examples

Worked example

Input
An orders table grows, and one lookup always searches by customer_id.
Expected output
customer_id

Hints and solution

Hint 1

Write down the starting state and walk through one example by hand.

Reveal worked answer

The lookup can use an index keyed by customer_id to find matching rows directly.

Back to the lesson