all repos — litestore @ 744fb690926f421d4024e5870a1edcbdc3c27886

A minimalist nosql document store.

Improved COUNT(docid) performance (added index).
h3rald h3rald@h3rald.com
Sun, 26 Apr 2015 18:11:30 +0200
commit

744fb690926f421d4024e5870a1edcbdc3c27886

parent

ff112ff6f18040178790cbfea8e2ffb794306c75

2 files changed, 5 insertions(+), 0 deletions(-)

jump to
M lib/core.nimlib/core.nim

@@ -26,6 +26,7 @@ if file.fileExists():

raise newException(EDatastoreExists, "Datastore '$1' already exists." % file) let store = db.open(file, "", "", "") store.exec(SQL_CREATE_DOCUMENTS_TABLE) + store.exec(SQL_CREATE_DOCID_INDEX) store.exec(SQL_CREATE_SEARCHCONTENTS_TABLE) store.exec(SQL_CREATE_TAGS_TABLE)
M lib/queries.nimlib/queries.nim

@@ -15,6 +15,10 @@ created TEXT,

modified TEXT) """ +const SQL_CREATE_DOCID_INDEX* = sql""" +CREATE INDEX docid_index ON documents(docid) +""" + const SQL_CREATE_SEARCHCONTENTS_TABLE* = sql""" CREATE VIRTUAL TABLE searchcontents USING fts4( id TEXT,