in reply to Re: how do hashes work - complexity question
in thread how do hashes work - complexity question

Seconded. But look at the OPs code. If the //select a row part actually fires a database query it's more than reasonable, that 10,000 iterations are somewhat faster than 5000000 =).


holli

You can lead your users to water, but alas, you cannot drown them.

Replies are listed 'Best First'.
Re^3: how do hashes work - complexity question
by zwon (Abbot) on Jul 11, 2009 at 11:51 UTC

    Yeah, I did actually mean that he can rewrite his DB code so it would look like:

    for (1..5) { # select content of table $_ into temp table } for (1..10000) { # crosscheck with temp table }
    and it's possible (it depends on exact requirements) that the later loop may be replaced with a single DB query.