Use of "long" in incremental sort code

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: James Coleman <jtc331(at)gmail(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Use of "long" in incremental sort code
Date: 2020-06-30 04:13:01
Message-ID: CAApHDvpky+Uhof8mryPf5i=6e6fib2dxHqBrhp0Qhu0NeBhLJw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2020-06-30 04:13:03 Re: pgsql: Enable Unix-domain sockets support on Windows
Previous Message higuchi.daisuke@fujitsu.com 2020-06-30 04:01:15 RE: [Bug fix]There is the case archive_timeout parameter is ignored after recovery works.