J
jeremy
Text
Why your index isn't being used
Article: Why your index isn't being used
When the two sides of a comparison have different types, the database converts one of them so they can be compared, and you usually never see it happen. Which side gets converted decides whether an index is usable: converting your literal is harmless, while converting the column means the engine must compute a new value for every row and the index over the original column is useless. This is why comparing a text column to a number, or a timestamp column to a date, can make a perfectly good index disappear from your plan.
Article: Why your index isn't being used