Results 1 to 4 of 4

Thread: Dbase Access, very slow

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: Dbase Access, very slow

    If you don't perform inserts, updates, and deletes in a transaction, each insert, update, and delete will be committed using an implicit transaction which will definitely slow down your program.

    Try wrapping your CRUD statements with a transaction as shown below:

    Qt Code:
    1. lite_db.transaction();
    2. // do all of your inserts/updates/deletes
    3. lite_db.commit(); // commit changes if successful or lite_db.rollback(); if you encountered an error, etc.
    To copy to clipboard, switch view to plain text mode 

    Another optimization would be to prepare your insert statement and use QSqlQuery::bindValue() to bind values to the named or unnamed query parameters, etc. Preparing the insert statement allows the db engine to optimize the query.

    Hope that helps.
    Last edited by jefftee; 25th March 2015 at 19:28.

Similar Threads

  1. Very slow startup by the first run
    By denizlitr in forum Qt for Embedded and Mobile
    Replies: 14
    Last Post: 2nd November 2016, 07:30
  2. Slow Microsoft Access QSqlQuery (possible bug)
    By yeikos in forum Qt Programming
    Replies: 0
    Last Post: 12th May 2014, 10:55
  3. Qt goes slow?
    By Cucus in forum Qt Programming
    Replies: 2
    Last Post: 20th July 2011, 04:43
  4. QT App performance is too slow on OSX
    By joshhhab in forum Newbie
    Replies: 1
    Last Post: 28th May 2011, 08:30
  5. QGraphicsScene too slow
    By samsam in forum Qt Programming
    Replies: 1
    Last Post: 10th July 2009, 16:18

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
  •  
Qt is a trademark of The Qt Company.