I have a fairly large table with 60million entries.
Lets call the table I have as bigtable
and the column as tracking_code
(of type varchar(8)).
When I use the query
SELECT * FROM bigtable WHERE tracking_code LIKE 'SDMASGG_';
It takes 0.75 seconds to execute whereas the query
SELECT * FROM bigtable WHERE tracking_code LIKE 'SDMA_GGH';
takes more than 9 minuites.
I am intrigued by the selectivity shown by mysql towards the location of the '_'