Hi !

An interesting enchantment may be (if anyone development that) an "VACUUM INFILE" method.
That is (when many pages are unuseable (free) in db) a "pragma signed" transaction.
If flag is -1, the db engine is use the last, and nearly to last pages. When flag is 1, the engine is use first, and nearly to first pages.
When many pages are deleted, we are use -1, and relocate datas. When it is finished, we are use 1, and relocate page nearly to file begin position.
If we have enough pages, the file size is not changed until this progress.
Then the empty pages are in the end of file, we can truncate that.


See that:

xxx xxx x x x xxx x             |
->                xxxxxxxxxxxxx |
xxxxxxxxxxxxx<-                 |
truncate
xxxxxxxxxxxxx|

This is like an unfragmenting method in windows file systems... :-)

But that is db engine dependent, so it is my idea now... :-)

Sorry for disturbing:
  ft

Dan Kennedy wrote:

Version 3.1 supports "pragma auto_vacuum" as an alternative.
3.1 is currently still in alpha stage though.

http://www.sqlite.org/pragma.html#modify








Reply via email to