Open tvesely opened 1 year ago
This is because we flush buffered ops and pick a new snapshot for each INSERT in the stored procedure -
/*
* YB: We have to RESET read point in YSQL for READ COMMITTED isolation level.
* A read point is analogous to the snapshot in PostgreSQL.
*
* We also need to flush all earlier operations so that they complete on the
* previous snapshot.
*
* READ COMMITTED semantics don't apply to DDLs.
*/
if (IsYBReadCommitted() && YBGetDdlNestingLevel() == 0)
{
elog(DEBUG2, "Resetting read point for statement in Read Committed txn");
HandleYBStatus(YBCPgFlushBufferedOperations());
HandleYBStatus(YBCPgResetTransactionReadPoint());
}
This is no easy way to solve this as of now. We will have to brainstorm on possible solutions, but this is longer term.
Jira Link: DB-7504
Description
Running a bulk load like the following takes as much as 100x longer when
yb_enable_read_committed_isolation=true
:This appears to be because batching is not occurring.
With
yb_enable_read_committed_isolation=true
:With
yb_enable_read_committed_isolation=false
:Warning: Please confirm that this issue does not contain any sensitive information