SQLite optimizations. (addressing #34)

- Added indexes.
- Only call OsuDB.insert() if necessary.
- Drop/recreate indexes for batch inserts.
- Added pragmas for "locking_mode" and "journal_mode".

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-03-07 18:05:18 -05:00
parent 4718cb9aa5
commit 5e9d9a491c
3 changed files with 23 additions and 7 deletions

View File

@@ -114,7 +114,8 @@ public class ScoreDB {
"combo INTEGER, " +
"perfect BOOLEAN, " +
"mods INTEGER" +
")";
");" +
"CREATE INDEX IF NOT EXISTS idx ON scores (MID, MSID, title, artist, creator, version);";
stmt.executeUpdate(sql);
} catch (SQLException e) {
ErrorHandler.error("Could not create score database.", e, true);