On Thu, 21 Oct 2010 00:32:28 -0700, Dustin Sallings <dus...@spy.net> wrote:
> > I realize sqlite3_analyzer will give me some good > data for general use, but I'd like to be able to > do this from within my app. Does anyone have a > lib-like thing I can use, or an internal sqlite API > that can help me out here? > > Mostly, I want to have an idea how fragmented I am. > My app can tremendously wreck a sqlite table right > now to the point where a reconstruction (vacuum, etc...) > is the difference between three hours and one minute. > I'd like to know when things are getting bad. PRAGMA page_count; and PRAGMA freelist_count; will give you some info, but not as much as sqlite3_analyzer. It might be enough in your case. Running a full analysis takes quite some time, you might as well start a VACUUM periodically. I would suggest to run it with half the frequency you intend to run the analysis. That way the time spent to this kind of housekeeping will be about the same. And you could consider PRAGMA auto_vacuum = 0 | NONE | 1 | FULL | 2 | INCREMENTAL; > If no such thing exists, I can build it, but I would > imagine it's been done before. -- ( Kees Nuyt ) c[_] _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users