- From: Dumitru Daniliuc <dumi@chromium.org>
- Date: Tue, 16 Mar 2010 16:50:00 -0800
- To: shane@sqlite.org
- Cc: public-webapps <public-webapps@w3.org>
- Message-ID: <e753f47f1003161750vc96c466lc3d24b3d961300eb@mail.gmail.com>
shane, i was hoping you could clarify a few things about AUTO_VACUUM: > However, the B-Tree balancing algorithm used by SQLite will attempt to > merge pages with neighbors when there space utilization drops below certain > thresholds. Minimum average fill for intkey leaves is 50%. For other pages I > think it's 66%. > according to http://www.sqlite.org/pragma.html#pragma_auto_vacuum: "Auto-vacuum does not defragment the database nor repack individual database pages the way that the VACUUM command does." so the way i understand these statements is: 1. sqlite always attempts to merge mostly-empty pages. the (auto-)vacuum settings have no effect on that. 2. AUTO_VACUUM only moves pages around and deletes the empty ones. it does not try to repack individual pages. however, because of #1, page repacking happens anyway (to some extent), when AUTO_VACUUM is on. am i right? and one more question: "Auto-vacuuming is only possible if the database stores some additional information that allows each database page to be traced backwards to its referer. Therefore, auto-vacuuming must be turned on before any tables are created. It is not possible to enable or disable auto-vacuum after a table has been created." what happens if we create a database without AUTO_VACUUM on, insert some data, save it to a file, then turn on AUTO_VACUUM and try to open that database again? will sqlite add the missing information? will AUTO_VACUUM be silently turned off for that database? will we get an error when we try to open/read from/write to that database? anything else that we need to be aware of in this case? thanks, dumi
Received on Wednesday, 17 March 2010 00:50:33 UTC