Short term we would at least need a way to tell if a database needs to be fragmented, this is actually not possible without manually parsing the database file page by page. That would be over-engineering, slow, and hard to maintain (if the file format changes).
Using Places Stats to get a "magic number" able to tell us if the database size is exagerated is not possible. We can get a guess, but in many cases it will generate false positives due to a couple things (i tried generating some spreadsheet to test the thing):
* external applications can add binary annotations and we can't guess what's the size of those.
* actually guessing an avg size of titles and urls for different locales can be hard.
* using an hard size limit is bad because mobile and other apps are going to save a smalleramount of informations.
We will ask SQLite team if it's possible to get a pragma option to analyze the database and get a guess if it needs to be vacuumed.