I have a query that selects records based on LastName and FirstName (the table has an index by LastName, FirstName):
SELECT * FROM CUSTOMERS WHERE LastName = 'Smith' AND FirstName = 'Susan'
This takes an average of 24 seconds to return 88 records
If I change the SQL statement to:
SELECT * FROM CUSTOMERS WHERE LastName = 'Smith' AND FirstName LIKE 'Susan'
It then takes less than one second to return the same data -- No other parameters are involved.
What is it that causes this? Tarek