Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to speed up inserting records into MySQL Server 5.5

How to speed up inserting records into MySQL Server 5.5

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VladimirPivovar
    wrote on last edited by
    #1

    Please tell me how i can maximize the number of inserted records.

    At this point the speed inserting 4000 records per second:

    @
    queryStringJAN = "INSERT INTO january";
    queryStringJAN = queryStringJAN + " (answer,dateOfCall,timeOfCall,phoneNumberA,phoneNumberB,callDuration,offset) VALUES ";
    queryStringJAN.append( QString( "(?,?,?,?,?,?,?)," ).repeated( 1000 ) );
    queryStringJAN.chop( 1 );
    if( !queryJAN.prepare( queryStringJAN ) )
    {
    qDebug() << "Unable to prepare query:" << query.lastError();
    return FALSE;
    }

    @

    @
    if (numCurrRecPrepared == 1000)
    {
    if( !queryJAN.exec() )
    {
    //qDebug() << "Unable to exec query:" << query.lastError();
    //
    return 0;
    }
    }
    @

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved