On a *nix platform you can have test.flac and Test.flac in the same directory.
So I first used this slow query:
Code: Select all
... WHERE BINARY relative_file = "' . mysql_real_escape_string($relative_file) . '"');So when you first do a normal compare that uses an index and then use the BINARY compare it will speed up.
MySQL goes from left to right with logical operators (the same as PHP) so it narrows the search results for BINARY compare.
Code: Select all
... WHERE relative_file = "' . mysql_real_escape_string($relative_file) . '"
AND BINARY relative_file = "' . mysql_real_escape_string($relative_file) . '"');Hope it will work out on your system to.