1. You can speed it all up with BerkeleyDB: http://www.sleepycat.com. Low overhead, and very speedy thanks to BTree sort. Within the database, put the fields in fixed with. Multiple index calls are slow, naturellement, compared to a set of numbers. Your mileage may vary, depending on OS, memory, CPU speed, CPU caches, disk caches, disk speed, etc,etc, so use

Benchmark


and find the best solution for your situation.

BTW, making a database with links to other database just to retrieve a password, seems *very* complicated for such an operation. Why not put it all in one file, or why don't you use a RDBM (MS SQL, Postgres, Oracle, MySQL, etc)?

2. If performance is an issue, just write to a copy, and lock that copy only when writing. Every 5 mins or so, let a cron (or at) job refresh the original dbase file, and lock that file during the refresh. Or use a RDBM, see above. Oh yeah, BerkeleyDB has a transaction system as well.

Hope this helps,

Jeroen
"We are not alone"(FZ)


In reply to Re: make perl text database fast? help! by jeroenes
in thread make perl text database fast? help! by psypete

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.