diff options
author | jasplin <qt-info@nokia.com> | 2010-02-25 16:10:15 +0100 |
---|---|---|
committer | jasplin <qt-info@nokia.com> | 2010-02-25 16:10:15 +0100 |
commit | 3eb754f291b5c58076861c3feb7c6c0f22392dd6 (patch) | |
tree | 85fe1e1fff6136ca51854a97bef062a624c67928 /src/bmserver | |
parent | 730d9d14ca202567509008f9218c716601857478 (diff) |
Partial implementation of performance index support.
The performance index support does not work yet.
It remains to implement the functions in indextree.cpp.
Diffstat (limited to 'src/bmserver')
-rw-r--r-- | src/bmserver/main.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/bmserver/main.cpp b/src/bmserver/main.cpp index a5431b5..bd52b7b 100644 --- a/src/bmserver/main.cpp +++ b/src/bmserver/main.cpp @@ -116,6 +116,20 @@ static bool initDatabase(const QString &dbfile, QString *error) ", UNIQUE(bmcontextId, snapshotId));"); Q_ASSERT(ok); + // index_ + ok = query.exec( + "CREATE TABLE index_(id INTEGER PRIMARY KEY AUTOINCREMENT" + ", indexId INTEGER REFERENCES index_(id)" + ", resultId INTEGER REFERENCES result(id)" + ", name TEXT" + ", description TEXT" + ", timestamp INTEGER NOT NULL" + ", weight REAL NOT NULL" + ", historyConstant REAL" + ", UNIQUE(name, timestamp));"); + Q_ASSERT(ok); + + // *** Create indexes *** ok = query.exec("CREATE INDEX index_metric_name ON metric(name);"); Q_ASSERT(ok); @@ -158,6 +172,13 @@ static bool initDatabase(const QString &dbfile, QString *error) ok = query.exec("CREATE INDEX index_result_all ON result(snapshotId, bmcontextId);"); Q_ASSERT(ok); + ok = query.exec("CREATE INDEX index_index_timestamp ON index_(timestamp);"); + Q_ASSERT(ok); + + // ### Hm ... does the following index have any effect? + ok = query.exec("CREATE INDEX index_index_timestamp_indexId ON index_(timestamp, indexId);"); + Q_ASSERT(ok); + return true; } |