]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Create index on blob(last_used)
authorMatt Joiner <anacrolix@gmail.com>
Tue, 19 Jan 2021 05:55:45 +0000 (16:55 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 25 Jan 2021 04:54:37 +0000 (15:54 +1100)
storage/sqlite/sqlite-storage.go

index 8ec4d5a6d42e6f3e48790bd5f317f5a12ff5e550..0e1edd1b9db463a454b94287e29876d43afb6bdf 100644 (file)
@@ -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