From 0223db6587263a7ac54a05bf28bf7e87c5ee2d7b Mon Sep 17 00:00:00 2001 From: Thomas Rudin Date: Wed, 9 Jan 2019 16:31:24 +0100 Subject: [PATCH] initial run todos --- db/sqlite.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/db/sqlite.go b/db/sqlite.go index 7985a8f..8474ba1 100644 --- a/db/sqlite.go +++ b/db/sqlite.go @@ -14,8 +14,7 @@ func init(){ } const migrateScript = ` -alter table blocks add mtime integer default NULL; -update blocks set mtime = strftime('%s', 'now'); +alter table blocks add mtime integer default 0; create index blocks_mtime on blocks(mtime); CREATE TRIGGER update_blocks_mtime_insert after insert on blocks for each row @@ -29,6 +28,9 @@ update blocks set mtime = strftime('%s', 'now') where pos = old.pos; end; ` +//TODO: initial run: https://stackoverflow.com/questions/14468586/efficient-paging-in-sqlite-with-millions-of-records +//TODO: postgres test + type Sqlite3Accessor struct { db *sql.DB filename string