I'm going to go against the grain a bit here... I don't believe an RDBMS would be right for you. You don't seem to need flexibility. You just need speed. Moving to an RDBMS now is also likely to be costly in terms of code changes.

I do think that you should be indexing your "shell" data though. I did something similar years ago by using an in-memory BerkeleyDB (DB_HASH). (It just so happens that I was working for a financial management company too.) Although what I did was all in C, I think you could actually do this pretty easily using BerkeleyDB from Perl and get all the real benefits. Keep in mind that, even though a 700MB file really isn't a big deal when you've got 16GB of RAM, Perl's representation of that data is going to include a lot of overhead, so it's best if you can skip it.

Doing it that way should have a pretty minimal affect on your code, all things considered. In fact, you might find it simplifies things. You won't need any heuristics to determine how to search your "shell"... you'll just iterate through your holdings doing lookups. I think that boils down to O(N) vs. O(N*M) in your current situation.

That's the direction I'd be looking anyway.

-sauoq
"My two cents aren't worth a dime.";

In reply to Re: Speeding up data lookups by sauoq
in thread Speeding up data lookups by suaveant

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.