Originally posted by nippala
MySQL (nor any other D😎 can't use indexes if you use OR-clause.
Sorry, this is absolutely, positively, 110% wrong. It is so wrong it's not even funny. I know of only one database that can't use indexes on ORed where clauses, and it's MySQL, the supposed "fastest" open source database. And it is, until you ask it to do something even marginally challenging, then it starts crawling.
From postgresql:
explain analyze select * from rax where corp_acct_id='0005902554' or corp_acct_id='0005903322';
Index Scan using rax_corp_acct_id_dx, rax_corp_acct_id_dx on rax (cost=0.00..27.15 rows=23 width=714)(actual time=0.06..1.18 rows=38 loops=1)
Total runtime: 1.28 msec
Note the time, on an 80,000 row table there. And this is on 7.2, which is about 2 years old.
PostgreSQL ain't slow no more.
Is obviously using an index. Most databases can use indexes on ORed qualifiers.