samedi 28 novembre 2015

Is it necessary to be concerned with sqlite file sizes used on an android device?

I have read that SQLite uses variable length records to keep sizes small. If I understand this correctly, my table currently has approximately 15 fields, mostly text, in each record. Based on that "variable" statement, if I only store data in one field (a unique ID), then that one record technically should be small. And therefore, if I add additional data to the "extra" empty fields, then that record should be "inflated" larger as needed.

My concern is, as the user manipulates the app, potentially the sqlite database could get very large. With a desktop/laptop and the associated processor speed, that is usually not an issue... but not 100% sure how this all affects devices/apps with more limited resources.

My original thought was as the older data is no longer immediately needed, I would "blank out" the extra field's data from certain records, leaving just that unique id field's info in that record. My thought was that "should" shrink the file size, potentially.

The question is, should I be concerned about file sizes and be doing something like I mentioned to "clean things up" over time? I also read about using the VACUUM command as well, but is not clear if that is needed unless physical records are actually deleted.

I guess this all falls under the same "theory" that "some" people have that "I have a terabyte hard drive on my laptop, why delete stuff"... or GMAIL (and other services) have UNLIMITED storage capacity so "there is nothing wrong with having tens of thousands of emails" (mostly spam I am sure). Never could understand this reasoning either.

Guess I hate clutter ... even though in my app's case, it "could" be a capacity issue.

Thanks

Pete

Aucun commentaire:

Enregistrer un commentaire