mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-17 19:13:16 +08:00
Always reset expr context in DecompressChunk
When decompressing very large compressed chunks as part of executing a `DecompressChunk`, the expression memory context was not reset after each qual evaluation if the qual did not match, meaning that if the qual did not match often, memory allocations would start to accumulate. This commit fixes this by resetting the expression memory context for each tuple when executing a `DecompressChunk` node, even if the qual did not match. Fixes #3620
This commit is contained in:
parent
6db012dcc9
commit
f8bf3b9767
@ -324,8 +324,6 @@ decompress_chunk_exec(CustomScanState *node)
|
||||
if (node->custom_ps == NIL)
|
||||
return NULL;
|
||||
|
||||
ResetExprContext(econtext);
|
||||
|
||||
while (true)
|
||||
{
|
||||
TupleTableSlot *slot = decompress_chunk_create_tuple(state);
|
||||
@ -335,6 +333,10 @@ decompress_chunk_exec(CustomScanState *node)
|
||||
|
||||
econtext->ecxt_scantuple = slot;
|
||||
|
||||
/* Reset expression memory context to clean out any cruft from
|
||||
* previous tuple. */
|
||||
ResetExprContext(econtext);
|
||||
|
||||
if (node->ss.ps.qual && !ExecQual(node->ss.ps.qual, econtext))
|
||||
{
|
||||
InstrCountFiltered1(node, 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user