Problems? Is your data what you think it is? | |
PerlMonks |
Comparing an array to a DBI tableby oakbox (Chaplain) |
on Jul 18, 2001 at 17:02 UTC ( [id://97631]=perlquestion: print w/replies, xml ) | Need Help?? |
oakbox has asked for the wisdom of the Perl Monks concerning the following question:
I have a list of userid's in an array. I have a DBI table. I want to find out which ID's in my array exist in my table. I have about three work-arounds for this problem, but all of them are time consuming and a big drain on resources. I was wondering if any of you have come up with an easy way to compare the contents of a list (array) against a table (Perl:DBI:MySQL). At the risk of looking like an idiot, here is one of my previous work-arounds: I have a list of userid's (@compare_array) that i want to compare to my subscription table.
The above system WORKS, and works pretty well for tables of <1000 records. But when I'm dealing with 10,000 or 50,000 records, this search becomes an incredible drain.
-oakbox.com
"If what I'm saying doesn't make sense, that's because sense cannot be made, it's something that must be sensed"
Back to
Seekers of Perl Wisdom
|
|