Actually, if disk space is not an issue and if you want to create a new DBI interface, you can make a blazingly fast database (suggested read only) on your local drive.
The only way to do it and to be fast on your local machine (or a local machine), is to use fixed width rows and columns. Doing this allows you to
seek across the rows and sysread data out. One you have done this, create fixed row indexes that map a column to the appropriate row in the real database. You can do a binary search on the index and get the right row out. If programmed correctly, you can get your correct row out with less than 20 file operations even on a database of over one million rows. This comes from experience. It can be done and the results are great (if done properly).
That said, you should use an RDBMS. They already have the interface written, the ability to create relations, do type checking, snapshot the data, handle locking, and allow for easy update and removal of data. The hand written solution I mentioned above is appropriate really if you aren't updating the data more than one or twice a day.
my @a=qw(random brilliant braindead); print $a[rand(@a)];
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.