Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
July 19, 2006, 10:48 pm
rate this thread
If I needed to fetch 3 entries from a database, is there a significant
performance difference between the following?
SELECT * FROM JOBS WHERE myCol IN ('val1','val2',val3');
SELECT * FROM JOBS WHERE myCol ='val1';
SELECT * FROM JOBS WHERE myCol ='val2';
SELECT * FROM JOBS WHERE myCol ='val3';
Re: IN vs individual queries, performance comparison
you are kidding, right? think about what happens during each "individual" query
- what if that table has 500,000 records - which is faster.
Just in case you were also wondering, the "IN" clause is an implicit "OR".
(where a=1 or a=2 or a=3...)
Donations welcomed. Http://www.firstdbasource.com/donations.html
- » Americanas.com SALDO de TVs Com at 80% de Desconto (29798)
- — Newest thread in » MySQL Database Forum