OK, OK: i correct  my bad programing  style.
And... forget the use of length. I´m new in this ;-).

But the problem remains. I will explain in in another way.

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)?

I need to resolve this because in the future  i will insert 500.000 IP
values or more and the database size will become enormous...(15 MB is too
big for me, 5 MB is OK).




Reply via email to