SELECT * FROM table_master WHERE column_id = 123
SELECT * FROM table_master WHERE column_id IN(456)
MSSQL execute above queries as follow.
SELECT * FROM table_master WHERE column_id = 123
SELECT * FROM table_master WHERE column_id = 456
By checking execution plan in MSSQL it looks similar to me for time difference.
But When I execute above queries there is bit time difference in MySQL.
SELECT * FROM table_master WHERE column_id = 123 -- 0.000 sec / 0.000 sec
SELECT * FROM table_master WHERE column_id IN(456) -- 0.016 sec / 0.000 sec
So what you guys suggesting for the MySQL? =
and IN
internally works same in MySQL
? or I should use =
in case of single value.