@@ -1839,15 +1839,15 @@ hash_agg_check_limits(AggState *aggstate)
1839
1839
uint64 ngroups = aggstate -> hash_ngroups_current ;
1840
1840
Size meta_mem = MemoryContextMemAllocated (aggstate -> hash_metacxt ,
1841
1841
true);
1842
- Size hash_mem = MemoryContextMemAllocated (aggstate -> hashcontext -> ecxt_per_tuple_memory ,
1843
- true);
1842
+ Size hashkey_mem = MemoryContextMemAllocated (aggstate -> hashcontext -> ecxt_per_tuple_memory ,
1843
+ true);
1844
1844
1845
1845
/*
1846
1846
* Don't spill unless there's at least one group in the hash table so we
1847
1847
* can be sure to make progress even in edge cases.
1848
1848
*/
1849
1849
if (aggstate -> hash_ngroups_current > 0 &&
1850
- (meta_mem + hash_mem > aggstate -> hash_mem_limit ||
1850
+ (meta_mem + hashkey_mem > aggstate -> hash_mem_limit ||
1851
1851
ngroups > aggstate -> hash_ngroups_limit ))
1852
1852
{
1853
1853
hash_agg_enter_spill_mode (aggstate );
@@ -1898,7 +1898,7 @@ static void
1898
1898
hash_agg_update_metrics (AggState * aggstate , bool from_tape , int npartitions )
1899
1899
{
1900
1900
Size meta_mem ;
1901
- Size hash_mem ;
1901
+ Size hashkey_mem ;
1902
1902
Size buffer_mem ;
1903
1903
Size total_mem ;
1904
1904
@@ -1910,15 +1910,15 @@ hash_agg_update_metrics(AggState *aggstate, bool from_tape, int npartitions)
1910
1910
meta_mem = MemoryContextMemAllocated (aggstate -> hash_metacxt , true);
1911
1911
1912
1912
/* memory for the group keys and transition states */
1913
- hash_mem = MemoryContextMemAllocated (aggstate -> hashcontext -> ecxt_per_tuple_memory , true);
1913
+ hashkey_mem = MemoryContextMemAllocated (aggstate -> hashcontext -> ecxt_per_tuple_memory , true);
1914
1914
1915
1915
/* memory for read/write tape buffers, if spilled */
1916
1916
buffer_mem = npartitions * HASHAGG_WRITE_BUFFER_SIZE ;
1917
1917
if (from_tape )
1918
1918
buffer_mem += HASHAGG_READ_BUFFER_SIZE ;
1919
1919
1920
1920
/* update peak mem */
1921
- total_mem = meta_mem + hash_mem + buffer_mem ;
1921
+ total_mem = meta_mem + hashkey_mem + buffer_mem ;
1922
1922
if (total_mem > aggstate -> hash_mem_peak )
1923
1923
aggstate -> hash_mem_peak = total_mem ;
1924
1924
@@ -1936,7 +1936,7 @@ hash_agg_update_metrics(AggState *aggstate, bool from_tape, int npartitions)
1936
1936
{
1937
1937
aggstate -> hashentrysize =
1938
1938
sizeof (TupleHashEntryData ) +
1939
- (hash_mem / (double ) aggstate -> hash_ngroups_current );
1939
+ (hashkey_mem / (double ) aggstate -> hash_ngroups_current );
1940
1940
}
1941
1941
}
1942
1942
0 commit comments