Hello Everyone,
I am working with QSqlQuery to fetch data from database tables.
Somehow i find it is quite slow for me.
What i am doing is i am fetching data from table around 15539502 rows.
which itself take 40-45 seconds., which is fine.
But when i am traversion this much amount of data it takes around 7-10 minutes.
which is quite long time.
QString query
("SELECT * FROM DATA_TABLE_1 (TICK_DATE BETWEEN :date_to AND :date_from) ORDER BY TICK_DATE ASC, TICK_TIME ASC");
sql_query.prepare(query);
sql_query.setForwardOnly(true);
bool ok = sql_query.exec();
if(ok &&
sql_query.size() > 0) {
// Do calculations
}
QString query("SELECT * FROM DATA_TABLE_1 (TICK_DATE BETWEEN :date_to AND :date_from) ORDER BY TICK_DATE ASC, TICK_TIME ASC");
QSqlQuery sql_query(m_ServerDB);
sql_query.prepare(query);
sql_query.setForwardOnly(true);
bool ok = sql_query.exec();
if(ok &&
sql_query.size() > 0) {
// Do calculations
}
To copy to clipboard, switch view to plain text mode
is there any way to doing the same with multiple threads to save time?
or anyidea to solve my problem.?
Bookmarks