- Code: Select all
std::vector<Poco::Tuple<unsigned, unsigned, double> > tabRows
which I am inserting into an open MySQL session using
- Code: Select all
ses << "INSERT INTO TableName VALUES(?, ?, ?)", use(tabRows), now;
It works, but it takes almost 160 seconds
Note that this is real time, the user- and sys-time, as reported by clock() from <ctime> or the "time" command on Linux, is only ca. 0.2 s - suggesting that almost all the time is spent waiting.
Interestingly, I hear the hard drive spinning like crazy the whole 2.5 minutes.
Is there some way to make this faster? I tried adding "bulk" into the use command, but it wouldn't compile.
I also tried inserting one row at a time, but it did not help either.
The 'solution' I found is to write the data into a csv file and then import the file into mysql manually; this takes only a fraction of a second.
I am using Poco 1.5, on linux (tested both 32 and 64 version), connected to a mysql server on localhost.
Thanks.
Michal





