
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-07 11:35:31 +02:00
2025-04-07 11:35:31 +02:00
2025-03-29 13:50:08 +01:00
2025-05-01 13:44:25 -05:00
2025-04-09 16:24:17 +02:00
2025-03-29 13:50:08 +01:00
2025-04-06 14:30:43 +02:00
2025-05-01 13:44:25 -05:00
2025-03-29 13:50:08 +01:00
2025-03-29 13:50:08 +01:00
2025-03-29 13:50:08 +01:00
2025-04-09 06:29:46 +02:00
2025-03-29 13:50:08 +01:00
2025-04-30 14:28:05 -05:00
2025-05-20 14:27:08 +02:00
2025-05-01 13:44:25 -05:00
2025-04-06 14:30:43 +02:00
2025-03-29 13:50:08 +01:00
2025-04-09 16:24:17 +02:00
2025-04-09 16:24:17 +02:00
2025-04-06 14:30:43 +02:00
2025-05-01 13:44:25 -05:00
2025-04-06 14:30:43 +02:00
2025-04-06 14:30:43 +02:00
2025-04-07 10:58:14 +02:00
2025-04-09 17:46:49 +02:00
2025-04-09 17:46:49 +02:00