SQLite Forum

Index Btree
I guess it would be possible to make a reasonable estimate using the [file format specification][1] in the documentation, but it will not be easy.

Additionally, you may want to study the [btree source code][2], and other sources. All sources have a lot of informative and accurate comments.

Note that integer numbers are stored in a [compact form][3], so low values consume fewer bytes than high values.

If you develop an algorithm, it would make sense to verify its validity with sqlite3_analyzer, which is available in the [sqlite-tools download][4] for your platform, or can be complied from source.

[1]: https://www.sqlite.org/fileformat2.html#b_tree_pages
[2]: https://www.sqlite.org/cgi/src/file?udc=1&ln=on&ci=trunk&name=src%2Fbtree.c
[3]: https://www.sqlite.org/cgi/src/file?ci=trunk&name=src/util.c&ln=895-913
[4]: https://www.sqlite.org/download.html