开发者

Do null SQLite Data fields take up extra memory?

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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜