crdv7 commented on code in PR #2517:
URL: https://github.com/apache/age/pull/2517#discussion_r3832129231
##########
src/backend/executor/cypher_set.c:
##########
@@ -415,6 +418,13 @@ void apply_update_list(CustomScanState *node,
HASHCTL hashctl;
HTAB *index_cache = NULL;
HASHCTL idx_hashctl;
+ MemoryContext old_context;
+
+ /*
+ * All callers reset this context before processing the next input row.
+ * Keep transient update state here so it has the same bounded lifetime.
+ */
+ old_context = MemoryContextSwitchTo(econtext->ecxt_per_tuple_memory);
Review Comment:
Thanks, you were right. `ExecUpdateLockMode()` was initializing
generated-column state in `es_query_cxt` for each temporary `ResultRelInfo`,
retaining one copy per input row and causing memory to grow with the row count.
The amended patch initializes that state in the EState per-tuple context for
SET/REMOVE and DELETE.
##########
src/backend/executor/cypher_merge.c:
##########
@@ -690,6 +717,9 @@ static TupleTableSlot *exec_cypher_merge(CustomScanState
*node)
TupleTableSlot *projected;
HeapTuple htup;
+ /* Release scratch retained by the preceding input row. */
+ ResetExprContext(econtext);
Review Comment:
`free_path_entry_array()` now frees both its entries and outer pointer array.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]