what is the exact difference or use of [sys_history_set] and [sys_history_line] tables with a simple example , time duration of records availability?

mallikharjunasw
Tera Contributor

what is the exact difference or use of [sys_history_set]  and  [sys_history_line] tables with a simple example , time duration of records availability?

1 REPLY 1

asifnoor
Kilo Patron

Hi,

The History Set [sys_history_set] table identifies which particular records from an audited table have historical information. The History [sys_history_line] table stores the actual changes to field values that occurred. The system automatically generates History Set and History records as needed from the Audit table when a user either creates a record or requests its history. Rather than containing a complete history of all changes in the system, History Set and History records only contain a recent subset of historical information for records where users have created or requested such information.

The system limits History Set and History records by:

  • Having the table cleaner delete History Set records that have not been updated in 30 days.
  • Using table rotation to rotate between four History tables every seven days. This means the system drops History records that are older than 28 days.

Ref: https://docs.servicenow.com/bundle/london-platform-administration/page/administer/security/concept/c...

Mark the comment as a correct answer and also helpful if it answers your question.