07.09.2011, 18:12
Do I gain much speed, when checking by SqlID (WHERE ID = %i), instead of (WHERE NAME = '%s')?
SELECT BENCHMARK(100000000,(SELECT `Name` FROM Accounts WHERE `Name` = 'SomeName' LIMIT 1));
SELECT BENCHMARK(100000000,(SELECT `Name` FROM Accounts WHERE `ID` = '1024' LIMIT 1));
[SQL]
SELECT BENCHMARK(100000000,(SELECT `Name` FROM Accounts WHERE `Name` = 'SomeName' LIMIT 1));
Affected rows: 0
Time: 4.055ms
[SQL]
SELECT BENCHMARK(100000000,(SELECT `Name` FROM Accounts WHERE `ID` = '1024' LIMIT 1));
Affected rows: 0
Time: 4.077ms