Audit Data Handling

The automatically generated Insert, Update, or Delete trigger in the After event on the audited table performs the auditing.

For each record, the trigger calls the corresponding procedure to compare each audited column to see if its value has changed. If changed, the system creates one row in the shadow table to store the old value(s).

The shadow table stores data in "sparse" format; unchanged values are stored as nulls. When a new record is inserted into an audited table, the system adds a row to the shadow table with a transaction type of Insert (I) with all column values represented as nulls (since null represents their previous, nonexistent, values). When a record is deleted from an audited table, the system adds a row to the shadow table with a transaction type of Delete (D) and all values stored.

Shadow tables do not compress data.