Skip to main content

Masking Heap Tables (KBA9742)




KBA# 9742

At a Glance

Summary: This page describes masking a Heap table using In-Place (IP) masking. The page also describes how to mask when there is:
  • No Logical Key (LK) (should be indexed)
  • No Primary Key (PK) (with Clustered index)
  • No IDENTITY column
  • Heap Table with Custom SQL
A Heap Table is technically a table without a Clustered Index. The Continuous Compliance Engine (aka Masking) has automated masking of these scenarios, but there are some edge cases where manual steps are needed. 
Applies to:  This applies to all In-Place masking jobs where the automation of the IDENTITY feature failed, is not available, or if there is a database block (will result in a hang) with SELECT COUNT (counting records). 
Custom SQL: Due to incompatibility between the Identity Column Feature and Custom SQL, the following databases need to use these steps when using Custom SQL
  • MS SQL Server
  • SAP ASE (Sybase)
  • PostgreSQL
  • MariaDB
A Feature is planned to automate this in the future (IDEA-3104). 
Oracle: This KBA does not apply to Oracle. 
Steps: The steps are:
  1. Manually:
    1. For the best performance and execution, check and drop all existing indexes on the table.
    2. Create a temporary IDENTITY column (for example 'DLPX_TMP_ID')
    3. Add an Index to this column (the best option is Clustered Index).
  2. Refresh the Rule Set.
  3. [if needed] Add Custom SQL and add all masked columns including the above created temporary IDENTITY column.
  4. [if needed] Assign Masking Algorithms.
  5. Run the Masking Job.
  6. Manually:
    1. Drop the temporary IDENTITY column (starting with its Index).
    2. Recreate any dropped indexes (in step 1.1). 
More info: More info on how to access logs: 

Databases and supported features:

Casting using SQL:

Applicable Delphix Versions

Click here to view the versions of the Delphix engine to which this article applies
Major Release All Sub Releases





Heap Table

A Heap Table is a table without a Clustered Index (a unique key). Since the table does not have a unique key it is not possible to use In-Place Masking. If In-Place masking is needed a temporary unique column needs to be added.


The best way to add a Unique Key is to add an Identity column. This is a column that will automatically generate a unique value per record in the table.


For best performance, remember to Index the Identity column.

IDENTITY Column Feature 

The Continuous Compliance Engine (aka Masking) has a built-in feature to automate the creation of an Indexed IDENTITY column on the following databases.

  • MS SQL Server
  • SAP ASE (Sybase)
  • PostgreSQL
  • MariaDB

This feature will automate the steps in this KBA and automatically create a column called MASKING_GENERATED_IDENTITY_TMP before masking. This column will be removed after the successful completion of the masking job. 

There is one exception, Custom SQL (see below).

Custom SQL

The Custom SQL feature will not work when the IDENTITY Column Feature is used. Please follow the procedure in this KBA when Custom SQL is used on Heap Tables.

A Feature is planned to automate this (IDEA-3104). 


The steps are:

  1. For the best performance and execution, check and drop all existing indexes on the table.
  2. Create a temporary IDENTITY column and add a Clustered Index to this column.
  3. Refresh the Rule Set.
  4. [if needed] Add Custom SQL and add all masked columns including the temporary IDENTITY column.
  5. [if needed] Assign Masking Algorithms.
  6. Run the Masking Job.
  7. Drop the temporary IDENTITY column (starting with its Index).
  8. Recreate any dropped indexes (in step 1). 



For assistance with scripting this, please contact your Customer Success Manager to engage Services or a Partner.