On Monday, June 24, 2002, at 11:21 , Bryan R Harris wrote:
[..]

> I'm surprised at how often the answer to a question is "You should be 
> using
> a hash, not an array."

because of the 'tree search' structure that simplifies the
query for the value - rather than the linear 'walk array
and test all elements' - that one is stuck with when
using flat arrays.

> So my question is, how many keys is too many?  Is
> there a rule of thumb?  (like "if you have over 500,000 items, use a 2-d
> array instead of a hash")

I think that is going the wrong direction - since clearly
walking that '2-d' array would be even worse than the tree parse....

I think the question should be:

        if I have 500,000 'key/val' pairs
        then
                why am I not putting them into a database structure
                so as to use the various DBI interfaces to do the
                queries and updates?

                rather than buying the start up time overhead to
                fill up my little perl code with this data?

Or what about:

If the nature of the data_model starts to look ugly enough
that you need to think about why not do this as a database
solution - then clearly the simple fix of 'stuff it in a hash'
has left with elvis to go to the mothership....



ciao
drieux

---


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to