
Jakob BorgandGitHub
085455d72e
feat: add syncthing debug database-statistics command (#10117)
This adds a command that shows database statistics. Currently it
requires a fork of the sqlite package to add the dbstats virtual table;
the modernc variant already has it.
This also provides the canonical mapping between folder ID and database
file, for tinkerers...
```
% ./bin/syncthing debug database-statistics
DATABASE FOLDER ID TABLE SIZE FILL
======== ====== == ===== ==== ====
main.db - folders 4 KiB 8.4 %
main.db - folders_database_name 4 KiB 6.0 %
main.db - kv 4 KiB 41.1 %
main.db - schemamigrations 4 KiB 3.9 %
main.db - sqlite_autoindex_folders_1 4 KiB 3.7 %
...
folder.0007-txpxsvyd.db w3ejt-fn4dm indexids 4 KiB 1.5 %
folder.0007-txpxsvyd.db w3ejt-fn4dm kv 4 KiB 0.8 %
folder.0007-txpxsvyd.db w3ejt-fn4dm mtimes 608 KiB 81.5 %
folder.0007-txpxsvyd.db w3ejt-fn4dm schemamigrations 4 KiB 3.9 %
folder.0007-txpxsvyd.db w3ejt-fn4dm sqlite_autoindex_blocklists_1 4108 KiB 89.5 %
folder.0007-txpxsvyd.db w3ejt-fn4dm sqlite_autoindex_blocks_1 700020 KiB 88.1 %
folder.0007-txpxsvyd.db w3ejt-fn4dm sqlite_autoindex_devices_1 4 KiB 3.6 %
folder.0007-txpxsvyd.db w3ejt-fn4dm sqlite_autoindex_kv_1 4 KiB 0.6 %
folder.0007-txpxsvyd.db w3ejt-fn4dm sqlite_schema 12 KiB 45.9 %
folder.0007-txpxsvyd.db w3ejt-fn4dm sqlite_sequence 4 KiB 1.0 %
folder.0007-txpxsvyd.db w3ejt-fn4dm sqlite_stat1 4 KiB 12.2 %
folder.0007-txpxsvyd.db w3ejt-fn4dm sqlite_stat4 4 KiB 0.2 %
folder.0007-txpxsvyd.db w3ejt-fn4dm (total) 1906020 KiB 92.8 %
main.db + children - (total) 2205888 KiB 92.0 %
```
2025-05-20 14:27:08 +02:00
..
2025-04-24 08:47:52 +07:00
2022-05-22 22:10:18 +02:00
2024-02-27 13:05:19 +01:00
2024-11-19 11:32:56 +01:00
2025-05-20 14:27:08 +02:00
2025-05-16 16:17:43 +02:00
2024-12-01 16:50:17 +01:00
2025-04-08 12:45:05 +00:00
2024-12-19 20:16:44 +00:00
2024-11-19 11:32:56 +01:00
2025-04-09 15:40:25 +02:00
2024-05-18 20:31:49 +03:00
2023-02-22 12:22:52 +01:00
2024-09-28 17:16:44 +02:00
2025-04-12 15:16:36 +02:00
2024-02-10 21:02:42 +01:00
2025-05-20 14:26:14 +02:00
2024-11-19 11:32:56 +01:00
2023-08-21 19:44:33 +02:00
2025-04-23 06:01:13 +00:00
2024-11-19 11:32:56 +01:00
2025-05-16 22:50:13 +02:00
2022-07-28 17:32:45 +02:00
2024-11-19 11:32:56 +01:00
2025-03-29 13:50:08 +01:00
2025-04-03 10:21:01 +02:00
2023-08-21 19:44:33 +02:00
2024-08-10 12:58:20 +01:00
2024-12-01 16:50:17 +01:00
2025-03-29 13:50:08 +01:00
2023-08-21 19:44:33 +02:00
2023-08-21 19:44:33 +02:00
2025-03-30 11:56:29 -07:00
2023-08-21 19:44:33 +02:00
2023-12-11 22:06:45 +01:00
2025-05-01 18:36:35 +00:00
2023-08-21 19:44:33 +02:00
2024-09-24 08:55:04 +02:00
2024-11-19 11:32:56 +01:00
2024-11-19 11:32:56 +01:00
2025-04-13 09:44:09 +02:00
2025-04-03 10:21:01 +02:00
2024-12-01 16:50:17 +01:00