AuroraDbBulkImportPseudoTableType

An enumeration that is being used to define the type of staging (pseudo) table to be created during the bulk-import operations.

This enum defines the type of staging (pseudo) table created during bulk-import operations. It applies only to Aurora PostgreSQL.

It is used by BulkInsert (only when identityBehavior is ReturnIdentity), BulkMerge, BulkUpdate, BulkDelete and BulkDeleteByKey.

Enum Values

Name Description
Auto Selects Physical when the entity/row count being bulk-written is 5,000 or more, otherwise selects Memory. This is the default.
Memory Backs the operation with a genuine TEMP table. Rows are session-private, isolating the execution from any concurrent executions on other connections.
Physical Backs the operation with an ordinary heap table. Rows are not session-isolated, so concurrent callers can see and interfere with each other’s staged rows, but it is faster and more efficient for large, sequential bulk operations.

Unlike CockroachDB, Aurora PostgreSQL supports temporary tables natively — Memory needs no special session flag here.

Usability

Pass the value to the pseudoTableType argument of the target operation.

using (var connection = new AuroraDbConnection(connectionString))
{
    var people = GetPeople(1000);
    var insertedRows = connection.BulkInsert(people,
        identityBehavior: AuroraDbBulkImportIdentityBehavior.ReturnIdentity,
        pseudoTableType: AuroraDbBulkImportPseudoTableType.Physical);
}