mercredi 27 avril 2016

Ability to control byte size of INTEGER type

I am trying to keep an SQLite table as small as possible. My tables will only contain 1 byte unsigned integers. However, it is unclear when I create a new table what the underlying structure of the table is that gets created. For example:

 CREATE TABLE test (SmallNumbers INTEGER)

Will the resulting SmallNumbers field be 1, 2, 4...8 bytes in size?

If I were to create 1 million records all containing the number "1" using the above command to create the table, would the resulting .db file be any smaller than if I inserted 1 million records all containing the value of 412,321,294,967,295?

How do I ensure that such a table can be as small as possible as I insert 1 byte unsigned integers into the table (with regards to disk space)?

Aucun commentaire:

Enregistrer un commentaire