hi,
if I create a QSqlDatabase, the .open() method call is extremly slow.
Does anyone know whats wrong?
best
ps.: I'm connecting on a local database
hi,
if I create a QSqlDatabase, the .open() method call is extremly slow.
Does anyone know whats wrong?
best
ps.: I'm connecting on a local database
I'm adding a database using the driver QPSQL7 :
Qt Code:
... m_db.setHostName(strHostName.c_str()); m_db.setDatabaseName(strDatabaseName.c_str()); m_db.setUserName(strUserName.c_str()); m_db.setPassword(strPassword.c_str()); m_db.setPort(iPort); ...To copy to clipboard, switch view to plain text mode
while calling:
my app blocks for about two seconds
Does it also block for two seconds if you use psql console? Maybe your database is clogged and needs some vacuuming? How did you calculate those two seconds, by the way? Like that?
Qt Code:
QTime t; t.start(); m_db.open(); qDebug() << t.elapsed();To copy to clipboard, switch view to plain text mode
Yes I did that...
I tried to vacuum the database (VACUUM tablename; ) before calling
But that caused a timedelay of 2,2 seconds... I have no clue whats wrong...
best,
Hoshy
Bookmarks