Re: Big performance slowdown from 11.2 to 13.3 - Mailing list pgsql-performance

From Peter Geoghegan
Subject Re: Big performance slowdown from 11.2 to 13.3
Date
Msg-id CAH2-WznibcXu2Uxn3zaXqZCEZyOx3ehMvjy5-_8wJNvYtR3eVw@mail.gmail.com
Whole thread Raw
In response to Re: Big performance slowdown from 11.2 to 13.3  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Big performance slowdown from 11.2 to 13.3  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Big performance slowdown from 11.2 to 13.3  (Ranier Vilela <ranier.vf@gmail.com>)
List pgsql-performance
On Thu, Jul 22, 2021 at 10:11 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> No, he already tried, upthread.  The trouble is that he's on a Windows
> machine, so get_hash_mem is quasi-artificially constraining the product
> to 2GB.  And he needs it to be a bit more than that.  Whether the
> constraint is hitting at the ngroups stage or it's related to actual
> memory consumption isn't that relevant.

Somehow I missed that part.

> What I'm wondering about is whether it's worth putting in a solution
> for this issue in isolation, or whether we ought to embark on the
> long-ignored project of getting rid of use of "long" for any
> memory-size-related computations.  There would be no chance of
> back-patching something like the latter into v13, though.

+1. Even if we assume that Windows is a low priority platform, in the
long run it'll be easier to make it more like every other platform.

The use of "long" is inherently suspect to me. It signals that the
programmer wants something wider than "int", even if the standard
doesn't actually require that "long" be wider. This seems to
contradict what we know to be true for Postgres, which is that in
general it's unsafe to assume that long is int64. It's not just
work_mem related calculations. There is also code like logtape.c,
which uses long for block numbers -- that also exposes us to risk on
Windows.

By requiring int64 be used instead of long, we don't actually increase
risk for non-Windows platforms to any significant degree. I'm pretty
sure that "long" means int64 on non-Windows 64-bit platforms anyway.

-- 
Peter Geoghegan



pgsql-performance by date:

Previous
From: "ldh@laurent-hasson.com"
Date:
Subject: RE: Big performance slowdown from 11.2 to 13.3
Next
From: Justin Pryzby
Date:
Subject: Re: Big performance slowdown from 11.2 to 13.3