SQLite table disk usage

You can use sqlite3_analyzer from https://www.sqlite.org/download.html.

It’s a really cool tool. It shows you the number of pages used by each table with and without indexes (each page, by default, is 1024 bytes).

This is a sample sqlite3_analyzer output for the Northwind database:

*** Page counts for all tables with their indices ********************

EMPLOYEES............................. 200         34.4% 
ORDERS................................ 152         26.2% 
CATEGORIES............................ 90          15.5% 
ORDER DETAILS......................... 81          13.9% 
CUSTOMERS............................. 17           2.9% 
SQLITE_MASTER......................... 11           1.9% 
PRODUCTS.............................. 7            1.2% 
SUPPLIERS............................. 7            1.2% 
TERRITORIES........................... 6            1.0% 
CUSTOMERCUSTOMERDEMO.................. 2            0.34% 
CUSTOMERDEMOGRAPHICS.................. 2            0.34% 
EMPLOYEETERRITORIES................... 2            0.34% 
REGION................................ 2            0.34% 
SHIPPERS.............................. 2            0.34% 

It also generates SQL statements which can be used to create a database with usage statistics, which you can then analyze.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)