"Shashank Tripathi" <shashank.tripathi@xxxxxxxxx> writes: >> select something from othertable; >> select * from table where table_id in (?, ?, ?, ?, ?, ?, ?, ...) > This is what MySQL's CEO Martin said in an interview on Slashdot. If > we can manage two queries as above through, say, a PHP application, > with each executing in 0.004 seconds, then an optimized subquery needs > to be beat the 0.008 mark to be a viable alternative. That certainly *should* be possible, because the subquery approach requires one less network round-trip, and less data marshaling/ transmission/demarshalling/back-the-other-way. If MySQL is seriously making that argument as a reason why they need not put work into subselects, you should be hearing strong echoes of their former positions about "you don't need foreign keys" and so on. regards, tom lane