diff options
author | Jochen Topf <jochen@topf.org> | 2014-05-13 22:33:23 +0200 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2014-05-13 22:33:23 +0200 |
commit | e8bd31b15ee35d4089d5fbd1a865ad9dc4abaaa4 (patch) | |
tree | e4c6f85bd8120ddbd540b03608278dd699161998 /sources | |
parent | 966010fc1e5c0bd257cd6c2874554476b2af1a2d (diff) | |
download | taginfo-e8bd31b15ee35d4089d5fbd1a865ad9dc4abaaa4.tar taginfo-e8bd31b15ee35d4089d5fbd1a865ad9dc4abaaa4.tar.gz |
Add pragmas to make the sqlite stuff run a little faster.
Diffstat (limited to 'sources')
-rwxr-xr-x | sources/db/update_characters.rb | 6 | ||||
-rw-r--r-- | sources/master/search.sql | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/sources/db/update_characters.rb b/sources/db/update_characters.rb index 9d253d2..a729818 100755 --- a/sources/db/update_characters.rb +++ b/sources/db/update_characters.rb @@ -31,6 +31,12 @@ dir = ARGV[0] || '.' db = SQLite3::Database.new(dir + '/taginfo-db.db') db.results_as_hash = true +db.execute("PRAGMA journal_mode = OFF"); +db.execute("PRAGMA synchronous = OFF"); +db.execute("PRAGMA count_changes = OFF"); +db.execute("PRAGMA temp_store = MEMORY;"); +db.execute("PRAGMA cache_size = 5000000;"); + #------------------------------------------------------------------------------ regexes = [ diff --git a/sources/master/search.sql b/sources/master/search.sql index 6c45182..f8555a2 100644 --- a/sources/master/search.sql +++ b/sources/master/search.sql @@ -8,6 +8,12 @@ .bail ON +PRAGMA journal_mode = OFF; +PRAGMA synchronous = OFF; +PRAGMA count_changes = OFF; +PRAGMA temp_store = MEMORY; +PRAGMA cache_size = 5000000; + ATTACH DATABASE '__DIR__/db/taginfo-db.db' AS db; DROP TABLE IF EXISTS ftsearch; |