Use of "long" in incremental sort code
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: James Coleman <jtc331@gmail.com>,
Tomas Vondra <tomas.vondra@2ndquadrant.com>, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2020-06-30T04:13:01Z
Lists: pgsql-hackers
Hi, I noticed the incremental sort code makes use of the long datatype a few times, e.g in TuplesortInstrumentation and IncrementalSortGroupInfo. (64-bit windows machines have sizeof(long) == 4). I understand that the values are in kilobytes and it would take 2TB to cause them to wrap. Never-the-less, I think it would be better to choose a better-suited type. work_mem is still limited to 2GB on 64-bit Windows machines, so perhaps there's some argument that it does not matter about fields that related to in-memory stuff, but the on-disk fields are wrong. The in-memory fields likely raise the bar further for fixing the 2GB work_mem limit on Windows. Maybe Size would be better for the in-memory fields and uint64 for the on-disk fields? David
Commits
-
Use int64 instead of long in incremental sort code
- 6ee3b5fb990e 14.0 landed
- 22c105595fc7 13.0 landed