Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-65226

Starting with version 5.10, the use of QSqlRecord runs 300 times slower

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.10.1, 5.11.0 Beta 1
    • 5.10.0
    • SQL Support
    • None
    • Linux Manjaro

      PostgreSql 9.3
    • 6c6ace9d23f90845fd424e474d38fe30f070775e (5.10.1) a924b4d58f66da44cd9a5ed8896f80a5121bac4a (5.11.0 beta 1)

    Description

      Example:

      #include <QCoreApplication>
      #include <QSqlDatabase>
      #include <QSqlQuery>
      #include <QSqlRecord>
      #include <QVariant>
      #include <QTime>
      #include <QDebug>
      
      int main(int argc, char* argv[])
      {
      QCoreApplication a(argc, argv);
      QSqlDatabase db = QSqlDatabase::addDatabase("QPSQL");
      db.setHostName("192.168.1.3");
      db.setDatabaseName("ML829MP1");
      db.open("postgres", "1");
      QSqlQuery q;
      q.exec("SELECT * FROM r4035");
      
      QTime time;
      time.start();
      
      while (q.next()) {
      QSqlRecord r = q.record();
      }
      
      qDebug() << "Qt version" << QT_VERSION_STR << ", size:" << q.size() << ", time:" << time.elapsed();
      db.close();
      return a.exec();
      }
      

      Output:

      Qt version 5.9.3 , size: 644 , time: 2
      Qt version 5.10.0 , size: 644 , time: 651

      This looks like a bug in the implicit sharing for QSqlRecord

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            andysh Andy Shaw
            n_r_w n_r_w
            Votes:
            5 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes