in reply to Basic Perl array intersection faster than mysql query join.

SQL has overhead to prepare queries -- stored procedures will probably be faster. But *more importantly* SQL has an overhead to establish a connection. When your data scales to 9 million rows, I seriously doubt Perl will be faster. Of course, in that case, you need to invest in something a little more robust than MySQL... (or at least move to postgres).

Do not confuse your test environment with your production environment when running benchmarks. Make sure both are equally complex and large. Also consider the network overhead, what kind of server you have running the DB, what kind of disks it has, etc. As your problem scales in complexity and data size, things can/will change.

My point of reference is batch operations for AT&T databases ... for a simple run-on-my-linux-box-for-purpose-X application, yeah, that may be a moot point.