Is it better to query large table (> 1.5 million rows) 3 times or to put 3 condition in the same query? The sample where clause is below. There are similar or more complicated where clauses. My hunch is to put all of them in same where. But need some input from community. Thanks in advance.
where (a =1 or b=1) and (a=2 or b=3) and (c=1 or d=3)
A single trip to the database is definitely preferable. Make sure you index the
a,b,canddcolumns and you should be fine.