Whats better query with long where in condition or many small queries?

Posted by DCrystal on Stack Overflow See other posts from Stack Overflow or by DCrystal
Published on 2010-04-26T18:23:21Z Indexed on 2010/04/26 18:23 UTC
Read the original article Hit count: 233

Filed under:
|
|

Maybe it's a little dumb, but i'm just not sure what is better. If i have to check about 30k rows in db for existanse, what i'd do?

#1 - one query

select id from table1 where name in (smth1,smth2...{till 30k})

#2 - many queries

select id from table1 where name=smth1

Though, perfomance is not the goal, i don't want to go down with mysql either ;) Maybe, any other solutions will be more suitable... Thanks.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about php