in reply to Re: Data store and threads
in thread Data store and threads

Yes, 2M. I can't store all data in memory. Data is like:
412415
535236642
32523
I just need to check presence of certain digits in this db.

Replies are listed 'Best First'.
Re^3: Data store and threads
by BrowserUk (Patriarch) on Feb 11, 2010 at 18:52 UTC
    Yes, 2M. I can't store all data in memory.

    Why not? A hash containing 2 million keys takes around 65 MB of memory:

    undef $h{ 0+ int rand 2**32 } for 1 .. 2e6;; print scalar keys %h;; 1999519 print total_size \%h;; 67353411
    assuming that i need to write/search through this data rapidly from several threads

    Can you say a little more about what you are doing with this data?

    What would you be writing to it?

    Do changes need to persist beyond the life of the program?

    How many threads?

    How rapidly?

    I just need to check presence of certain digits in this db.

    Do you mean numbers rather than "digits"?


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.