Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.10.0
-
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
For Gerrit Dashboard: QTBUG-65226 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
215332,3 | QSqlRecord: (re)speedup indexOf(const QString& name) | 5.10 | qt/qtbase | Status: MERGED | +2 | 0 |
216053,10 | psql: Improve performance of record() | 5.10.1 | qt/qtbase | Status: MERGED | -2 | 0 |
220450,4 | psql: do not try to get table name when PQftable returns InvalidOid | 5.11 | qt/qtbase | Status: MERGED | +2 | 0 |