Use of "long" in incremental sort code - Mailing list pgsql-hackers

From David Rowley
Subject Use of "long" in incremental sort code
Date
Msg-id CAApHDvpky+Uhof8mryPf5i=6e6fib2dxHqBrhp0Qhu0NeBhLJw@mail.gmail.com
Whole thread Raw
Responses Re: Use of "long" in incremental sort code  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Use of "long" in incremental sort code  (Peter Geoghegan <pg@bowt.ie>)
List 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



pgsql-hackers by date:

Previous
From: "higuchi.daisuke@fujitsu.com"
Date:
Subject: RE: [Bug fix]There is the case archive_timeout parameter is ignored after recovery works.
Next
From: Amit Kapila
Date:
Subject: Re: pgsql: Enable Unix-domain sockets support on Windows