Hello Helen and Norman,
Ok, thanks to you, now is some way clearer...
we have set sweep = 0 and we make a scheduled "manual" sweep every
morning at 05:00. My fault is that, in my expectations, the sweep = 0
condition would suffice to disable completely the GC in daily hours. In
daily hours, sometimes we have many massive updates to entire table
records, that causes the garbage to grow rapidly.
Now, i will test the db with "background" GC mode. I think you have
solved my troubles, but i'll report to you the results.
Thanks for now !
Arnaldo
On 16/02/2018 20:23, Helen Borrie hele...@iinet.net.au
[firebird-support] wrote:
Hello Arnaldo,
Friday, February 16, 2018, 2:19:19 AM, Arnaldo wrote:
> maybe i have always misunderstood the garbage collection mechanism, the
> sweep interval, etc.. and i'm realising only now, but:
> I have this database (Firebird 3.03 SuperServer x64)
> My question is : why garbage collection mechanism starts automatically
> when i browse these tables, despite the fact that i have Sweep Interval
> = 0 ? What is the point that i'm missing ?
Some more thoughts to add to Norm's comments...
Garbage collection (GC) and sweeping are separate, although
interrelated, processes. By setting the sweep interval to 0, you
disable automatic sweeping (according to the conditions described by
Norm) but you get GC regardless of the sweep interval setting. The
sweep interval setting has no effect on the GC that is being performed
constantly by the engine.
A GC run updates the record statistics but it does not remove the
stubs of deleted records.
There are three possible settings for the GcPolicy parameter in
firebird.conf to govern how GC is performed: background, cooperative
and combined. The GC mechanism described by Norm is 'cooperative':
each time a user opens a table, old record versions from others' work
will be flagged if they are no longer "interesting" and previously
flagged versions will be removed.
Superserver can also do 'background': that is, a worker thread that
wakes up periodically and runs in the background, doing the same
tasks that cooperative does. Background GC is not available in Classic
or Superclassic.
For SS, the default GcPolicy setting is 'combined': both background and
cooperative mechanisms are used. You can change this to 'background' or
'cooperative' if you want to test whether unexpected slowdowns are being
caused by one or other of the two GC mechanisms.
The GcPolicy setting has no effect on either the sweep interval or the
way the engine performs a sweep.
Periodic sweeping will be needed if auto sweeping is disabled. Watch
the statistics to determine how often you might need to do it. An "ad
hoc" manual sweep might be needed after a large batch of deletes, to
get rid of those delete stubs.
A gbak backup does a sweep by default, unless you run it with the -g
switch ( [no_]g[arbage-collection] ). If you have a regular backup
routine with the default settings, you might not need to run manual
sweeps at all. However, you will need them if you are relying only on
nBackup for your backups, as nBackup does not touch garbage.
HB
--
------------------------------------------------------------------------
*Arnaldo Caliari*
StudioSoft Informatica srl
http://www.studiosoft.eu
+39 334 3249274
info[at]studiosoft.eu