Results 1 to 8 of 8

Thread: Very slow sqlite performance?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2017
    Posts
    14
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Very slow sqlite performance?

    System Info:
    OS: Debian
    Kernel: 4.4
    Platform: BeagleBoneBlack
    Sqlite3: version (SQLite version 3.8.7.1 2014-10-29 13:59:56).

    DB Info:
    Schema: CREATE TABLE Table1 (rowId INTEGER PRIMARY KEY AUTOINCREMENT, parm varchar(32), value varchar(32));
    Total Rows: 164

    If I drop into terminal, manually open DB, and issue a simple update command like (UPDATE Table1 SET value='45' WHERE parm='Parm3') it is very fast. It will occasionally lag for a second or so. I set pragma synchronous = OFF, and same with journal_mode, just to test. This makes it even faster, and I never see the occasional lag.

    So I use Qt to open the DB, set those same pragma settings, and use something like this:
    Qt Code:
    1. QSqlQuery query;
    2. QString strQuery = QString("UPDATE %1 SET value='%2' WHERE parm='%3'").arg(table).arg(value).arg(setting);
    3.  
    4. QTime *time = new QTime();
    5. query.prepare(strQuery);
    6. time->start();
    7.  
    8. if(!query.exec()) {
    9. qDebug() << "Error with query:: " << strQuery << "|" << query.lastError();
    10. return false;
    11. }
    12.  
    13. qDebug() << "Duration::" << time->elapsed();
    To copy to clipboard, switch view to plain text mode 

    This results in an output of an elapsed time between 2000-3000 with the same simple update command? Not every time, but like 1/5 updates it will hangup for a few seconds. Again, I use the same pragma settings and update command via terminal and it runs like butter, but via Qt it seems to have a ton of overhead on ~1/5 updates. Has anyone run into this issue, or have any insight as to why this might be the case?
    Last edited by while_e; 19th September 2017 at 18:21.

Similar Threads

  1. Replies: 5
    Last Post: 24th December 2015, 16:57
  2. Phonon performance slow down
    By rspock in forum Qt for Embedded and Mobile
    Replies: 4
    Last Post: 10th June 2013, 08:47
  3. Slow SQLite performance
    By themagician in forum Newbie
    Replies: 0
    Last Post: 26th April 2012, 15:23
  4. QT App performance is too slow on OSX
    By joshhhab in forum Newbie
    Replies: 1
    Last Post: 28th May 2011, 09:30
  5. Replies: 1
    Last Post: 8th August 2010, 21:04

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.