Recently, various incremental vacuum features have been added, so you can do:

 -- Turn on incremental vacuum.
 PRAGMA auto_vacuum = incremental;

 -- Release 100 pages from the freelist, or all if there are fewer.
 PRAGMA incremental_vacuum(100);

 -- Return the number of items on the freelist.
 PRAGMA freelist_count;

Based on this, I find myself wondering if there could be something like:

 -- Vacuum up 10% of the freelist when it exceeds 20% of the total space.
 PRAGMA auto_vacuum = incremental(20, 10);

The basic goal would be to leave some slack in the system so that free
pages can be allocated nearby to related pages, but kick in with some
cleanup when the amount of unused space exceeds a threshold.  A
secondary goal is to not get too tied up with freelist-clearing - in
the above, if half the pages were releases, then it would take four or
five transactions to get the freelist back under control.

One could do this manually if there were a PRAGMA returning the total
number of pages.  Just wondering if there are plans to make it
automagic.

Thanks,
scott

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to