SQLite Forum

Wasted file space estimate
Login
Hi,

as I see, one can estimate a free space inside an sqlite file by multiplying the big endian dword at the offset 36 by the page size. Is this correct assumption?  I had an example recently when I didn't know whether a 4GB base was vacuumed or not and this gave me a 1.5 GB estimate more or less confirmed after the VACUUM. 

Also I know that the file format is probably not going to change anytime soon so if this assumption is correct, one can even write a hard-coded function accessing this 36-offset value, but adding a pragma reporting the free space estimate would be great. In this case Sqlite can take some border cases or other wizard knowledge if I missed something.

Thanks