Why QSqlDatabase db QOCI very slow when QSqlQuery is calling next() function ?
-
wrote on 22 Feb 2019, 19:30 last edited by
Driver Oracle 12g
QSqlDatabase db = QSqlDatabase::addDatabase("QOCI");
db.setUserName("bomfuturo_dev");
db.setHostName("#########");
db.setPassword("#########");
db.setDatabaseName("AGMQAS");
db.setPort(1521);
db.setConnectOptions("OCI_ATTR_PREFETCH_ROWS=1000;OCI_ATTR_PREFETCH_MEMORY=1000");
db.open();QSqlQuery rs(db); rs.setForwardOnly(true); if(rs.exec(query)){ while(rs.next()) -----> it's very slow { qDebug() <<"dado" << rs.value(0).toString(); } }
-
wrote on 22 Feb 2019, 19:32 last edited by
I've encountered someone else with the same problem I'm having
link: https://bugreports.qt.io/browse/QTBUG-27098 -
Hi,
Did you try to use the fix provided in bug report ?
-
wrote on 23 Feb 2019, 00:26 last edited by
@SGaist no
-
Then it might be a good idea to do so.
-
wrote on 24 Feb 2019, 00:33 last edited by
@SGaist ok
-
wrote on 24 Feb 2019, 00:36 last edited by
@SGaist how can i do it?
-
@SGaist how can i do it?
@Everton-Fonseca
HI
The bug comments says
"Resolution: This issue was resolved by set OCI_ATTR_PREFETCH_ROWS and/or OCI_ATTR_PREFETCH_MEMORY parameter with SqlDatabase::setConnectOptions() function."so use
https://doc.qt.io/qt-5/qsqldatabase.html#setConnectOptionsand try with
setConnectOptions("OCI_ATTR_PREFETCH_ROWS;OCI_ATTR_PREFETCH_MEMORY" -
@Everton-Fonseca
HI
The bug comments says
"Resolution: This issue was resolved by set OCI_ATTR_PREFETCH_ROWS and/or OCI_ATTR_PREFETCH_MEMORY parameter with SqlDatabase::setConnectOptions() function."so use
https://doc.qt.io/qt-5/qsqldatabase.html#setConnectOptionsand try with
setConnectOptions("OCI_ATTR_PREFETCH_ROWS;OCI_ATTR_PREFETCH_MEMORY"wrote on 24 Feb 2019, 09:51 last edited by@mrjj I did it
-
@mrjj I did it
@Everton-Fonseca
and did it help ? -
@Everton-Fonseca
and did it help ?wrote on 24 Feb 2019, 21:44 last edited by@mrjj yet it isn't working
-
@Everton-Fonseca
and did it help ?wrote on 24 Feb 2019, 21:45 last edited by@mrjj look at example db.setConnectOptions("OCI_ATTR_PREFETCH_ROWS=1000;OCI_ATTR_PREFETCH_MEMORY=1000");
it was before open database -
@mrjj look at example db.setConnectOptions("OCI_ATTR_PREFETCH_ROWS=1000;OCI_ATTR_PREFETCH_MEMORY=1000");
it was before open database@Everton-Fonseca
ok. odd. the poster said it fixed it for him.
Other poster said ODBC worked better for him.
1/13