Answer the question
In order to leave comments, you need to log in
Why is LIKE request processed faster than EQUAL?
We have a simple table for ~ 3 million records.
CREATE TABLE `MTRIVI` (
`id` int(11) NOT NULL,
`numero` varchar(45) NOT NULL,
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
ALTER TABLE `MTRIVI`
ADD PRIMARY KEY (`id`),
ADD KEY `numero` (`numero`);
Answer the question
In order to leave comments, you need to log in
because in the first example, the comparison is not with a string, but with a number, hence the type casting and the query goes past the index, which is clearly displayed in the plan. key column
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question