I'm using the Qt database abstraction layer to interface with Sqlite3.
int x = GetTickCount();
database.exec("UPDATE controls SET dtype=32 WHERE id=2");
qDebug() << GetTickCount()-x;
The table is:
CREATE TABLE controls (
id INTEGER PRIMARY KEY AUTOINCREMENT,
internal_id TEXT,
name TEXT COLLATE NOCASE,
config TEXT,
dtype INTEGER,
dconfig TEXT,
val TEXT,
device_id INTEGER REFERENCES devices(id) ON DELETE CASCADE
);
Results in an update time of ~100 ms! Even though nothing else is accessing the db and there are a grand total of 3 records in that table.
That seems ridiculously long to me. 10 records would already take a second to complete. Is this the performance I should expect from sqlite or is something messing me up somewhere? SELECT queries are fast enough ~1ms.
Edit 1
So it's not Qt.
sqlite3 *db;
if ( sqlite3_open("example.db",&db ) != SQLITE_OK )
{
qDebug() << "Could not open";
return;
}
int x = GetTickCount();
sqlite3_exec(db, "UPDATE controls SET dtype=3 WHERE id=2",0,0,0);
qDebug() << "Took" << GetTickCount() - x;
sqlite3_close(db);
This guy takes just the same amount of time.