Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c3399f3

Browse files
committed
WIP add comments here and there
1 parent 42e2c10 commit c3399f3

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/partition_router.c

+8-3
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,12 @@ partition_router_exec(CustomScanState *node)
223223
/* Magic: replace parent's ResultRelInfo with ours */
224224
estate->es_result_relation_info = state->current_rri;
225225

226-
/* Delete tuple from old partition */
226+
/* Lock or delete tuple from old partition */
227227
Assert(ItemPointerIsValid(&ctid));
228228
slot = router_lock_or_delete_tuple(state, slot, &ctid,
229229
&deleted, estate);
230230

231-
/* We require a tuple */
231+
/* We require a tuple (previous one has vanished) */
232232
if (TupIsNull(slot))
233233
goto take_next_tuple;
234234

@@ -265,12 +265,15 @@ partition_router_rescan(CustomScanState *node)
265265
}
266266

267267
void
268-
partition_router_explain(CustomScanState *node, List *ancestors, ExplainState *es)
268+
partition_router_explain(CustomScanState *node,
269+
List *ancestors,
270+
ExplainState *es)
269271
{
270272
/* Nothing to do here now */
271273
}
272274

273275

276+
/* Smart wrapper over ModifyTable */
274277
static TupleTableSlot *
275278
router_run_modify_table(PlanState *state)
276279
{
@@ -309,6 +312,7 @@ router_run_modify_table(PlanState *state)
309312
return slot;
310313
}
311314

315+
/* Return tuple OR stash it and change ModifyTable's operation */
312316
static TupleTableSlot *
313317
router_set_slot(PartitionRouterState *state,
314318
TupleTableSlot *slot,
@@ -337,6 +341,7 @@ router_set_slot(PartitionRouterState *state,
337341
return NULL;
338342
}
339343

344+
/* Fetch next tuple (either fresh or stashed) */
340345
static TupleTableSlot *
341346
router_get_slot(PartitionRouterState *state,
342347
bool *should_process)

0 commit comments

Comments
 (0)