Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I'm trying to estimate the database size (on disk) for a SQLite DB that includes a number of indexed columns. These columns are of (SQLite) type Integer and String. It's straightforward enough to estimate the size per row with these columns, but I'm not sure how to account for the extra per-row padding due to the indexes. What's the best approach for this?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

At least some of the details of index B-trees are documented.

It might be easier to just create a test database, populate it, and measure the file size before and after creating an index.

share|improve this answer
    
I did end up creating a test database as you suggested. Of course the results would be specific to my schema, but in case its helpful to anyone I measured a 9% decrease in size when I dropped the indexes (which I rounded to 10% for estimation purposes). –  Greg Jun 23 '11 at 15:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.