in reply to Re^6: looping efficiency
in thread looping efficiency

Writing to a single DB versus 5,000 separate files could speed things up considerably.

There are various buffering issues that effect throughput to the hard disk.
For INSERT's into a DB, the concept of a "transaction" matters a lot.
The database will attempt to maintain ACID properties.
The number of transactions per second is important.

A million INSERTs can be run as a single transaction.
In my SQLite testing, about 128K INSERT rows per transaction is just fine.
That means that waiting until a million rows, doesn't make any significant performance difference.

An obvious thing to do, is to buy an SSD disk. That eliminates the rotational delays associated with a normal HD.
Do not use that SSD disk for the O/S - use just for this big 25GB file.

Update: I am still not sure why you need these leading zeroes?