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

If that is a sound approach, then my entire project could be reduced to simple selects of the form
select col_2 from theTable where col_1 = $some_value;
and then finding the intersection of two or more arrays.

In that case, I am on a mission to find the absolutely most efficient array-interesection-finder routine possible. Yes, I've read and tried solutions from perlfaq4, and variations found by a search here on PM. I wonder if for the very specific application of two lists, each between 4,000 and 10,000 elements long, there isn't some ultra-simple and rapid approach.

Replies are listed 'Best First'.
Re^2: Basic Perl array intersection faster than mysql query join.
by dragonchild (Archbishop) on Oct 12, 2004 at 17:40 UTC
    Here's another thought - if your database will only ever be used to find intersections, why not pre-calculate all of them in some manner? Just because your database is normalized doesn't mean it's the right schema for your purpose.

    For example, I have selectively denormalized my reporting database, just to reduce the number of table joins. Since I control all writing to the database and the database is specialized to a given purpose, this is a good breaking of the rules.

    Being right, does not endow the right to be rude; politeness costs nothing.
    Being unknowing, is not the same as being stupid.
    Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
    Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.