History tables
The Pega Platform database tables that initially contain history instances are insert-only tables. New rows are added but existing rows are not ordinarily deleted or updated.
Work item history
Normal processing of a work item using one or more flow executions produces work item history instances. They document who updated the work item, when the update occurred, the assignment task or other task within the flow, and other facts. Agent processing and other automatic processing also may add to work item history.
These records support auditing and the detailed history display that is typically available by clicking History on user forms.
Normally, all such instances are rows in the
pc_history_work
table, which
contains all classes derived from the
History-Work-
class. In terms of
row count, this table often grows to become one of the largest in the
Pega Platform
database.
A database view in the Pega Platform database provides an alternate means for reporting on work history. See Database views.
If a
Data-Admin-DB-Table
instance for a work item history class does
not exist, the system saves the history instances in the
pr_history
table
by default. This does not provide the best performance.
Data object history
When you save a new or updated instance of an administrative data class, a corresponding history instance identifying the date, time, and operator who made the change is created.
These records support auditing needs and the detailed history display available on the History tab.
For example, when a calendar instance is updated — Data-Admin-Calendar class — the history instance is of class History-Data-Admin-Calendar.
Normally, all such instances are rows in the
pr_history_data
table.
When a rule is deleted, a row is appended in the history table, as with other operations. The history rows are not deleted, although the rule that caused them to be recorded is gone.
Rule history
When a developer saves a new or updated instance of rule, a corresponding history instance identifying the date, time, and operator who made the change is created. For example, when a property is updated — Rule-Obj-Property class — the history instance is of class History-Rule.
Rule history records support auditing needs, the Restore toolbar button, the Recover
toolbar button, and the detailed history display available on the History tab. Normally, all
such instances are rows in the
pr4_history_rule
table.
When a rule is deleted, a row is appended in the history table, as with other operations. History rows are not deleted, although the rule that caused them to be recorded is gone.
Other history instances
The
pr_history
table is associated with the
History-
base class
, and holds rows for objects in concrete
classes derived from
History-
other than those in the tables described
above. For example, as initially configured during installation, instances recording the
history of delegated rules (
History-System-User-MyRules
class) map to
the
pr_history
table.
The
pr_history
table has only a few exposed columns. As a best practice
for good performance, configure your
Pega Platform
database so that
classes with a high volume of saved instances or activity are not mapped to this table.
Ensure that this table does not contain history instances for work items or data objects.
Some applications might have thousands or millions of history records for high-turnover
classes such as interest rates. As a best practice, create dedicated tables with exposed
columns for such classes, or add indexes to eliminate table scans and add exposed columns to
avoid retrieving the
Storage Stream.