MCPcopy Create free account
hub / github.com/apache/cloudberry / ExecUpdateLockMode

Function ExecUpdateLockMode

src/backend/executor/execMain.c:3502–3521  ·  view source on GitHub ↗

* ExecUpdateLockMode -- find the appropriate UPDATE tuple lock mode for a * given ResultRelInfo */

Source from the content-addressed store, hash-verified

3500 * given ResultRelInfo
3501 */
3502LockTupleMode
3503ExecUpdateLockMode(EState *estate, ResultRelInfo *relinfo)
3504{
3505 Bitmapset *keyCols;
3506 Bitmapset *updatedCols;
3507
3508 /*
3509 * Compute lock mode to use. If columns that are part of the key have not
3510 * been modified, then we can use a weaker lock, allowing for better
3511 * concurrency.
3512 */
3513 updatedCols = ExecGetAllUpdatedCols(relinfo, estate);
3514 keyCols = RelationGetIndexAttrBitmap(relinfo->ri_RelationDesc,
3515 INDEX_ATTR_BITMAP_KEY);
3516
3517 if (bms_overlap(keyCols, updatedCols))
3518 return LockTupleExclusive;
3519
3520 return LockTupleNoKeyExclusive;
3521}
3522
3523/*
3524 * ExecFindRowMark -- find the ExecRowMark struct for given rangetable index

Callers 2

ExecBRUpdateTriggersFunction · 0.85
ExecOnConflictUpdateFunction · 0.85

Calls 3

ExecGetAllUpdatedColsFunction · 0.85
bms_overlapFunction · 0.85

Tested by

no test coverage detected