Optimize A Simple MySQL Query Running Slow Because Of An "OR" In The WHERE Clause?
SELECT * FROM mytable WHERE field1="test" OR field2="test" limit 1;
This takes two seconds to run (vs. 0.00 for each search separately), and it refuses to use any index, even with FORCE INDEX. I would like to be able to run one search instead of two, and this seems very basic, but I can't find any info on how to do this! Please help me, MySQL gurus!
This takes two seconds to run (vs. 0.00 for each search separately), and it refuses to use any index, even with FORCE INDEX. I would like to be able to run one search instead of two, and this seems very basic, but I can't find any info on how to do this! Please help me, MySQL gurus!
You may use the access query tool "Advanced Access Builder" at http://www.download5000.com/page25449.aspx or http://www.dlkj.net/sqlBuilder , it allows you to visually build complete SQL scripts.
You may use the access query tool "Advanced Access Builder" at http://www.download5000.com/page25449.aspx or http://www.dlkj.net/sqlBuilder , it allows you to visually build complete SQL scripts.
Lol, I don't know
http://en.wikipedia.org/wiki/Mysql
http://en.wikipedia.org/wiki/Mysql