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

I found the same thing with c and Oracle.

Your memory/disc thing is a very good point, the other important point here is the access path, especially with complex joins and big tables. The acess path that the database pick might not be the most optimized one.

One usually code for the best algorithm for a specific situation, but database has to follow some algorithm that is faster for most situations, but not the fastest for every situation.

But my experience with Oracle, usually it is a good idea just let the database do whatever it thinks as right, unless the difference is too big. By doing this, you reduce the chance of bugs in your code. Some take give thing.

  • Comment on Re^2: Basic Perl array intersection faster than mysql query join.

Replies are listed 'Best First'.
Re^3: Basic Perl array intersection faster than mysql query join.
by DrHyde (Prior) on Oct 13, 2004 at 08:32 UTC
    The acess path that the database pick might not be the most optimized one.

    The EXPLAIN command can be useful when trying to figure out exactly what the database is doing, and how to optimise it.