Dear monks,

I have a quite modest dataset of various financial data (high-frequency currency quotes over a course of years) at the size of around 15 GB. I used to keep it in plaintext files, but now I'd want to run some simple queries with it. Hence, I need a database. I tried MySQL, but 15 gigs seems to be too much for it, with indices in place. Therefore, I put in PostgreSQL.

Now to the question. The usual scenario for this database is going to be 'gimme a whole set of quotes for a certain few days for latter aggregation'. This gives me a resultset which amounts to hundreds of megabytes. It's obvious that I don't want to put it all into memory. At once. For every aggregation request (even with caching, it can be several requests per minute). So, I need a cursor. And guess what? Cursors seem to be not supported in DBD::Pg at all!

Can you enlighten me on the alternatives I have in this situation? Figure out how to use PL/perl? Use another database? Drop the database at all and stick to my beloved plain text data files? Something else? I'd really appreciate a solution.


In reply to PostgreSQL cursors with Perl. by atemerev

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.