Fix misleading comment in tuplesort.c
authorDavid Rowley <drowley@postgresql.org>
Tue, 9 Dec 2025 23:01:14 +0000 (12:01 +1300)
committerDavid Rowley <drowley@postgresql.org>
Tue, 9 Dec 2025 23:01:14 +0000 (12:01 +1300)
commitf275afc997d77ada991307d22703b08f1dedef13
tree267b5ccd8e12e9f0926c8d1ac8b36569dcffdaac
parent1b105f9472bdb9a68f709778afafb494997267bd
Fix misleading comment in tuplesort.c

A comment in tuplesort.c was claiming that the code was defining
INITIAL_MEMTUPSIZE so that it *does not* exceed
ALLOCSET_SEPARATE_THRESHOLD, but the code actually ensures that we
purposefully *do* exceed ALLOCSET_SEPARATE_THRESHOLD for the initial
allocation of the tuples array, as per reasons detailed in the
commentary of grow_memtuples().

Also, there's not much need to repeat the mention about
ALLOCSET_SEPARATE_THRESHOLD in each location where INITIAL_MEMTUPSIZE is
used, so remove those comments.

Author: ChangAo Chen <cca5507@qq.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: David G. Johnston <david.g.johnston@gmail.com>
Discussion: https://postgr.es/m/tencent_6FA14F85D6B5B5291532D6789E07F4765C08%40qq.com
src/backend/utils/sort/tuplesort.c