Skip to content

Commit 564ce62

Browse files
Rename "hash_mem" local variable.
The term "hash_mem" will take on new significance when pending work to add a new hash_mem_multiplier GUC is committed. Rename a local variable that happens to have been called hash_mem now to avoid confusion.
1 parent 1e0dfd1 commit 564ce62

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/backend/executor/nodeAgg.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,7 +1896,7 @@ static void
18961896
hash_agg_update_metrics(AggState *aggstate, bool from_tape, int npartitions)
18971897
{
18981898
Size meta_mem;
1899-
Size hash_mem;
1899+
Size hashkey_mem;
19001900
Size buffer_mem;
19011901
Size total_mem;
19021902

@@ -1908,15 +1908,15 @@ hash_agg_update_metrics(AggState *aggstate, bool from_tape, int npartitions)
19081908
meta_mem = MemoryContextMemAllocated(aggstate->hash_metacxt, true);
19091909

19101910
/* memory for the group keys and transition states */
1911-
hash_mem = MemoryContextMemAllocated(aggstate->hashcontext->ecxt_per_tuple_memory, true);
1911+
hashkey_mem = MemoryContextMemAllocated(aggstate->hashcontext->ecxt_per_tuple_memory, true);
19121912

19131913
/* memory for read/write tape buffers, if spilled */
19141914
buffer_mem = npartitions * HASHAGG_WRITE_BUFFER_SIZE;
19151915
if (from_tape)
19161916
buffer_mem += HASHAGG_READ_BUFFER_SIZE;
19171917

19181918
/* update peak mem */
1919-
total_mem = meta_mem + hash_mem + buffer_mem;
1919+
total_mem = meta_mem + hashkey_mem + buffer_mem;
19201920
if (total_mem > aggstate->hash_mem_peak)
19211921
aggstate->hash_mem_peak = total_mem;
19221922

@@ -1934,7 +1934,7 @@ hash_agg_update_metrics(AggState *aggstate, bool from_tape, int npartitions)
19341934
{
19351935
aggstate->hashentrysize =
19361936
sizeof(TupleHashEntryData) +
1937-
(hash_mem / (double) aggstate->hash_ngroups_current);
1937+
(hashkey_mem / (double) aggstate->hash_ngroups_current);
19381938
}
19391939
}
19401940

0 commit comments

Comments
 (0)