Closed psarna closed 1 year ago
Better example, with results aggregated per table:
sqlite> select * from dbstat where aggregate = true;
name path pageno pagetype ncell payload unused mx_payload pgoffset pgsize
------------- ---- ------ -------- ----- ------- ------ ---------- -------- ------
sqlite_schema 1 1 31 3953 31 4096
t 85 5 337265 10491 171721 348160
Interesting fields are pgsize
, which is a misnomer and contains the total size a table occupies. payload
contains a sum of useful bytes a table occupies, not counting internal fragmentation inside pages. (So payload/pgsize
tells you how well the disk space is utilized)
libSQL has a virtual table --
dbstat
-- which prints useful information about which tables/indexes use how much storage. Let's integrate it into the CLI to present this information in a more human-readable way.Example: