From b59443f1360a756ea70d52f07b86eff47ed82671 Mon Sep 17 00:00:00 2001 From: bt90 Date: Fri, 29 Aug 2025 11:12:39 +0200 Subject: [PATCH] chore(db): avoid rowid for blocks and blocklists (#10315) ### Purpose Noticed "large" autgenerated indices on blocks and blocklists in https://forum.syncthing.net/t/database-or-disk-is-full-might-be-syncthing-might-be-qnap/24930/7 They both have a primary key and don't need rowids ## Authorship Your name and email will be added automatically to the AUTHORS file based on the commit metadata. --- internal/db/sqlite/sql/schema/folder/50-blocks.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/db/sqlite/sql/schema/folder/50-blocks.sql b/internal/db/sqlite/sql/schema/folder/50-blocks.sql index 17c8e40a0..3c2ca8bc1 100644 --- a/internal/db/sqlite/sql/schema/folder/50-blocks.sql +++ b/internal/db/sqlite/sql/schema/folder/50-blocks.sql @@ -14,7 +14,7 @@ CREATE TABLE IF NOT EXISTS blocklists ( blocklist_hash BLOB NOT NULL PRIMARY KEY, blprotobuf BLOB NOT NULL -) STRICT +) STRICT, WITHOUT ROWID ; -- Blocks @@ -30,5 +30,5 @@ CREATE TABLE IF NOT EXISTS blocks ( size INTEGER NOT NULL, PRIMARY KEY (hash, blocklist_hash, idx), FOREIGN KEY(blocklist_hash) REFERENCES blocklists(blocklist_hash) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED -) STRICT +) STRICT, WITHOUT ROWID ;