From: Matt Joiner Date: Tue, 19 Jan 2021 05:55:45 +0000 (+1100) Subject: Create index on blob(last_used) X-Git-Tag: v1.22.0~14 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=c424a2510e1fc88f8825cc9987e17f8d515463d3;p=btrtrc.git Create index on blob(last_used) --- diff --git a/storage/sqlite/sqlite-storage.go b/storage/sqlite/sqlite-storage.go index 8ec4d5a6..0e1edd1b 100644 --- a/storage/sqlite/sqlite-storage.go +++ b/storage/sqlite/sqlite-storage.go @@ -73,6 +73,8 @@ func InitSchema(conn conn, pageSize int, triggers bool) error { key text primary key, value ); + + create index if not exists blob_last_used on blob(last_used); -- While sqlite *seems* to be faster to get sum(length(data)) instead of -- sum(length(cast(data as blob))), it may still require a large table scan at start-up or with a