List:MySQL++« Previous MessageNext Message »
From:a b Date:April 4 2007 5:43am
Subject:bulk insert optimization required
View as plain text  
Hello,

Currently i am using mysql++ for bulk insert.
mysql++ only let me insert 2,000,000 records in approximately 2
minutes with the help of mysqlpp::query::insert(iterator,iterator)
method.
But due to performance reasons, i want to insert these records in no
more than 6-10 seconds.

Can anyone tell me the alternative approaches for bulk insert?


My source code is as follow:

outer=400,inner=5000;

mysqlpp::DateTime dt;
time_t t=time(NULL);
for(int i=0;i<outer;i++)
{
vector<t2> col;
convert(t,dt);
mysqlpp::DateTime dt1(dt);
for(int j=0;j<inner;j++)
{
t2 e(j,dt1,1,1);
col.push_back (e);

}
query.insert (col.begin (),col.end ());
query.execute ();
t=t+1;
query.reset ();


}

regards,
imran siddiqui
Thread
bulk insert optimization requireda b4 Apr
  • Re: bulk insert optimization requiredMr.Dragomir Stanchev4 Apr
    • Re: bulk insert optimization requiredWarren Young5 Apr
      • Re: bulk insert optimization requireda b5 Apr
        • Re: bulk insert optimization requiredWarren Young5 Apr
          • Re: bulk insert optimization requiredM Imran Siddiqui5 Apr
            • Re: bulk insert optimization requiredWarren Young6 Apr