dbsync_app.compact_local_changes()

Compact local registered changes.

Syntax

FUNCTION compact_local_changes(
      tabname STRING
  )
  RETURNS INTEGER
  1. tabname refers to the table name.
Returns:
  1. The status.

Usage

Use this function to reduce the changes registered by the DB Sync client application, for a given table name.

Successive changes on a given row (with the same primary key) are scanned, in order to remove the changes that are useless.
   I, U|C, U|C, ...          => I (all columns) with stash data from last U|C
   U|C, U|C, U|C, ...        => U (all columns) with stash data from last U|C
   C(3), C(4,5), C(3,7), ... => C(3,4,5,7) with stash data from last C
   U|C, [U|C, ...] D         => D is sufficient
   I, [U|C, ...] D           => remove all change log records for this pkey
   U|C, [U|C, ...] D, I, D   => D
   U|C, [U|C, ...] D, I      => no compacting (could do D,I)

The compactable change sequence is interrupted when a different primary key is found for this sync log table.

The useless change records and stash data records are deleted.