The following example shows a query with a known search condition:
SELECT *
FROM Flights
WHERE orig_airport = 'SFO'
The search value, 'SFO', is known. The optimizer will be
able to make an accurate estimate of the cost of using the index
orig_index.
In addition, if the index is unique, and the WHERE clause involves an
= or IS NULL comparison to all the columns in the index, the
optimizer knows that only a single row will be scanned from disk. For
example:
-- there's a unique key on city_id
SELECT * FROM Cities WHERE city_id = 1