On 08/19/2010 01:27 PM, Taras Glek wrote:
 Hi,
I really appreciate that sqlite got this feature to reduce fragmentation, but why not expose this as a pragma? In many cases it is not feasible to pass the chunk size via a C API. For example with a pragma I could do fragmentation testing via an sqlite shell, now this option is out without modifying the shell source. I presume that a similar problem exists for users of scripting languages until every single scripting host provides support for this.

Perhaps this should even persist similar to how page_size persists across connections.

Taras
To the patronizing "i don't believe this is a problem" and "even if it is, Linux is superior to windows" concerns: Attached my earlier email to the dev list showing that fragmented files can be 3x slower to access than non-fragmented ones.

Trivia:
XFS on Linux gets a prize for being the most fragmentation-prone filesystem in my survey. It is roughly 10-30x worse than everybody else. Ext4 is ok, not great. Windows has a builtin autodefrag that on some occasions ensures that our Firefox databases are not fragmented(ie it beats the crap out of Linux contrary to the "classic" wisdom). Even Apple's horrific filesystem occasionally results in less fragmented files due to autodefrag.

For more details see

http://blog.mozilla.com/tglek/2010/07/22/file-fragmentation/

I already have a patch for Firefox that makes use of the new API, we don't require a new pragma. It just seems like an important feature for performance-tuning sqlite that isn't easy to get at for many users.

Taras
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to