The following queries do provide start and stop conditions for a scan of
the primary key index on the
flight_id and
segment_number columns in
Flights:
-- the where clause compares both columns with valid
-- operators to constants
SELECT *
FROM Flights
WHERE flight_id = 'AA1115'
AND segment_number < 2
-- the first column is in a valid comparison
SELECT *
FROM Flights
WHERE flight_id < 'BB'
-- LIKE is transformed into >= and <=, providing
-- start and stop conditions
SELECT *
FROM Flights
WHERE flight_id LIKE 'AA%'