The Pega 7 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.
pc_history_work
- Work item historypr_history
- Holds rows for objects in concrete classes derived from History- that are not stored in other tablespr_history_data
- Data object historypr4_history_rule
- Rule historyNormal 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 7 database.
The pzInsKey for these instances is formed by concatenating the value of these properties:
For example, the pzInsKey value
HISTORY-PEGASAMPLE PEGASAMPLE C-43!20041109T204536.146 GMT
identifies a history record for the work item C-43 in the PegaSample work pool, added on November 9, 2004. The pxHistoryForReference value in this instance is PEGASAMPLE C-43.
A database view in the Pega 7 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.
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.
The pzInsKey for these instances is formed by concatenating the value of these properties:
For example, the pzInsKey value:
HISTORY-DATA-ADMIN-ORGANIZATION DATA-ADMIN-ORGANIZATION FORMCO ! 20051207T144054.968 GMT
identifies an organization data instance named FormCo that was updated on December 7, 2005 at 14:40 GMT.
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.
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.
The pzInsKey for these instances is formed by concatenating the value of these properties:
For example, the pzInsKey value:
HISTORY-RULE RULE-OBJ-PROPERTY DELTA-HR-OPS RNAME #20040927T234826.687 GMT!20051109T143059.254 GMT
identifies a change to a property named Rname that applies to the class Delta-HR-Ops. The property was created on September 27, 2004, and updated on November 9, 2005.
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.
The pr_history
table is associated with theHistory- 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 7 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.