> I create the database in this way: > > PRAGMA page_size=4096; > CREATE TABLE domains (group_id NUMERIC, domain NUMERIC); > CREATE INDEX idx_domain ON domains (domain ASC); > > I create an index in domain because i want to make sentences where the WHERE > clause will appear in this way > SELECT group_id WHERE domain=IPnumber > > > The database empty has 12.288 bytes. > Then i insert 510 IP values (nothing in group_id for the moment). > Now the database size is 28.672 bytes. > This is the number that i don“t understand. Because: > (28.672 - 12.288)/510 = 31 bytes per row. > I think it will be: > 4 bytes for the group_id > 4 bytes for the domain > 4 bytes for the idx_domain > ------ > 12 bytes in total > > Where are the rest of the bytes (23 bytes)?
The btree will take up some space but it shouldn't grow linearly as you add records. Why not write a simple program to enter 500000 records and see how large it is?