views:

44

answers:

1

I'm using the built in sqlite library on the Android platform.

I'm considering adding several general purpose fields that users will be able to use for their own custom applications, but these fields will be blank most of the time.

My question is, how much overhead will these blank fields add to my database? Do null fields even take up per record memory in sqlite? If so, how much? I don't quite understand the inner workings of a sqlite database.

+1  A: 

The SQLite file format is described here. A NULL field will take one byte.

One way to provide custom/optional fields is to put them in a separate table with a foreign key identifying the corresponding record. Then no additional record is required if there are no custom fields, though there will be a need to do joins to gather all the fields when there are custom fields.

Doug Currie
I'm already using a many-to-many setup relating these notes to the rest of my database and joining more tables into the mix would get very messy.
CodeFusionMobile