Details
-
Suggestion
-
Resolution: Won't Do
-
P3: Somewhat important
-
None
-
5.7.0, 5.9.1, 5.11.1
-
Windows 7, Qt 5.9.1, Qt 5.7
Description
Hello,
I'm experiencing poor performance with a basic QSqlQueryModel displayed in a QTreeView under SQL Server when the DB is on a distant network.
The row selection hover effect and the selection are laggy (~5 FPS) and the lag is proportionnal to the network latency.
This has nothing to do with the number of records retrieved (10 records is enough).
Since with my sample code, all the data is displayed on the screen, I guess there shouldn't be any network accesses but it seems that it behaves differently.
It may be related to the SQL driver that does not support "forwardOnly" mode and "QuerySize" feature.
Can you do something about it ?
Sample code :
#include <QApplication> #include <QDebug> #include <QSqlDatabase> #include <QSqlQueryModel> #include <QTreeView> int main(int argc, char *argv[]) { QApplication a(argc, argv); // init db QSqlDatabase BDD = QSqlDatabase::addDatabase("QODBC",nomConnexion); BDD.setDatabaseName("DATABASE=XXXXX;SERVER=XXX.XX.XX.XX;DRIVER=SQL Server Native Client 11.0;"); BDD.setUserName("XXX"); BDD.setPassword("YYY"); BDD.open(); QSqlQueryModel *model = new QSqlQueryModel(); model->setQuery("SELECT TOP 10 ID FROM USER", BDD); QTreeView *aTreeView = new QTreeView(); aTreeView->setModel(model); aTreeView->setSelectionMode(QTreeView::SelectionMode::ExtendedSelection); aTreeView->show(); return a.exec(); }
Attachments
Issue Links
- relates to
-
QTBUG-977 QSqlCachedResult can potentially be optimized by fetching and caching fields lazily
- Closed