First of all, do you have an index for your table? If not, that might explain why looking up a single record takes a lot of time.

But anyway, a mere 25000 records is simple to hold into memory in Perl all at once. So my advice is: select all data from the table, and read it all into a Perl data structure, for example, HoH, where the keys are your key field, and the values are the records, as hashes. That will not take more than a few seconds. Next, go through this structure one at a time, and insert the data into the output database.

I've noticed that outputting all data to a text file, like CSV, may be quite a bit swifter, which you can then import into your dB using an import tool.


In reply to Re: Searching and sorting a large DBF file by bart
in thread Searching and sorting a large DBF file by tyndyll

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.