Commit 564ce621 authored by Peter Geoghegan's avatar Peter Geoghegan

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.
parent 1e0dfd16
...@@ -1896,7 +1896,7 @@ static void ...@@ -1896,7 +1896,7 @@ static void
hash_agg_update_metrics(AggState *aggstate, bool from_tape, int npartitions) hash_agg_update_metrics(AggState *aggstate, bool from_tape, int npartitions)
{ {
Size meta_mem; Size meta_mem;
Size hash_mem; Size hashkey_mem;
Size buffer_mem; Size buffer_mem;
Size total_mem; Size total_mem;
...@@ -1908,7 +1908,7 @@ hash_agg_update_metrics(AggState *aggstate, bool from_tape, int npartitions) ...@@ -1908,7 +1908,7 @@ hash_agg_update_metrics(AggState *aggstate, bool from_tape, int npartitions)
meta_mem = MemoryContextMemAllocated(aggstate->hash_metacxt, true); meta_mem = MemoryContextMemAllocated(aggstate->hash_metacxt, true);
/* memory for the group keys and transition states */ /* memory for the group keys and transition states */
hash_mem = MemoryContextMemAllocated(aggstate->hashcontext->ecxt_per_tuple_memory, true); hashkey_mem = MemoryContextMemAllocated(aggstate->hashcontext->ecxt_per_tuple_memory, true);
/* memory for read/write tape buffers, if spilled */ /* memory for read/write tape buffers, if spilled */
buffer_mem = npartitions * HASHAGG_WRITE_BUFFER_SIZE; buffer_mem = npartitions * HASHAGG_WRITE_BUFFER_SIZE;
...@@ -1916,7 +1916,7 @@ hash_agg_update_metrics(AggState *aggstate, bool from_tape, int npartitions) ...@@ -1916,7 +1916,7 @@ hash_agg_update_metrics(AggState *aggstate, bool from_tape, int npartitions)
buffer_mem += HASHAGG_READ_BUFFER_SIZE; buffer_mem += HASHAGG_READ_BUFFER_SIZE;
/* update peak mem */ /* update peak mem */
total_mem = meta_mem + hash_mem + buffer_mem; total_mem = meta_mem + hashkey_mem + buffer_mem;
if (total_mem > aggstate->hash_mem_peak) if (total_mem > aggstate->hash_mem_peak)
aggstate->hash_mem_peak = total_mem; aggstate->hash_mem_peak = total_mem;
...@@ -1934,7 +1934,7 @@ hash_agg_update_metrics(AggState *aggstate, bool from_tape, int npartitions) ...@@ -1934,7 +1934,7 @@ hash_agg_update_metrics(AggState *aggstate, bool from_tape, int npartitions)
{ {
aggstate->hashentrysize = aggstate->hashentrysize =
sizeof(TupleHashEntryData) + sizeof(TupleHashEntryData) +
(hash_mem / (double) aggstate->hash_ngroups_current); (hashkey_mem / (double) aggstate->hash_ngroups_current);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment