Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Fetch Mysql huge database

by Anonymous Monk
on Sep 29, 2011 at 11:49 UTC ( [id://928536]=note: print w/replies, xml ) Need Help??


in reply to Fetch Mysql huge database

Ummm...

SELECT BIG.primary_key FROM big_table BIG
LEFT OUTER JOIN other_table OTH ON (BIG.primary_key = OTH.primary_key)
WHERE OTH.primary_key IS NULL;


Now you have the primary-keys of all the rows in BIG that do not have a corresponding row in OTH. You didn't write a single line of Perl code. Not a single row (except the solution) ever left the confines of the SQL server. The database did all the work. If you need to test other combinations of columns, build an index on those column-sets in both tables first.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://928536]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-03-28 18:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found