Most honourable Monks,
I am at an impasse. I have data (well, will have, right now I'm working with dynamically created test data) which, if stored as plaintext, should take up about 40G - in other words, I can fit it in files on an only moderately expensive hard drive. However, I need sublinear-time access to the data. It's very simple, all key-value pairs where the keys are between 10 bytes and 100 bytes and the values are between 10 bytes and 300 bytes.
qq(Perfect!); I thought. qq(There's no way that a tied hash will double the size, I can fit this all on one hard drive!);
Yeah, no. Test data with SDBM_File-tied hashes shows 12.3m of data taking 467m of space. Needless to say, this will not work for me, as I can't afford 40 hard drives.
So, to the point, my question is: are there implementations of efficient persistant storage mechanisms that still have ~log(x) access time? With the number of hard drive cache misses I'll be having, and considering the size of the data, linear access is not an option.
And yes, I've gone through the first ten pages of Google's results for tie and hash, and supersearched, and read the Cookbook, etc.
If there isn't one implemented, I'll write one myself, but I hate to reinvent the wheel only to discover that my octagon is inferior to an already-made, pre-polished circle.
Thanks (in advance) for your time!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.