What will work better when searching for a key with a specific prefix in MySQL ?; -
i) where left (X, 2) = "AB"
or
ii) where X is like "AB%"
Assuming you have an index in a column, the second is faster. The database can use the index when you use LIKE, but you cannot use LEFT. Technically speaking, LIKE is mobile, but LEFT is not. You can find more information here .