I just ran into a curious issue with MySQL. I had a very slow query, even if properly indexed, which was like this:
SELECT * FROM `tbl1` WHERE `parm1` = 'taleggio' AND `parm2` = 10
As said both parm1
and parm2
had indexes. The query was taking from 0.2s up to 120s, depending on the searched values.
Then I quoted the search terms like this:
SELECT * FROM `tbl1` WHERE `parm1` = 'taleggio' AND `parm2` = '10'
and now the execution takes 0.02s! Why that?
taleggio
is not a column or I'd have an error