Re: Removing "long int"-related limit on hash table sizes
Bruce Momjian <bruce@momjian.us>
From: Bruce Momjian <bruce@momjian.us>
To: Andres Freund <andres@anarazel.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Thomas Munro <thomas.munro@gmail.com>, Jeff Davis <pgsql@j-davis.com>, pgsql-hackers@lists.postgresql.org
Date: 2021-07-25T01:39:34Z
Lists: pgsql-hackers
On Sat, Jul 24, 2021 at 06:25:53PM -0700, Andres Freund wrote: > > That's because they spill to disk where they did not before. The easy > > answer of "raise hash_mem_multiplier" doesn't help, because on Windows > > the product of work_mem and hash_mem_multiplier is clamped to 2GB, > > thanks to the ancient decision to do a lot of memory-space-related > > calculations in "long int", which is only 32 bits on Win64. > > We really ought to just remove every single use of long. As Thomas > quipped on twitter at some point, "long is the asbestos of C". I think > we've incurred far more cost due to weird workarounds to deal with the > difference in long width between windows and everything else, than just > removing all use of it outright would incur. +1 As I understand it, making long of undermined length was to allow someone to choose a data type that _might_ be longer than int if the compiler/OS/CPU was optimized for that, but at this point, such optimizations just don't seem to make sense, and we know every(?) CPU supports long-long, so why not go for something concrete? Do we really want our feature limits to be determined by whether we have an optimized type longer than int? -- Bruce Momjian <bruce@momjian.us> https://momjian.us EDB https://enterprisedb.com If only the physical world exists, free will is an illusion.
Commits
-
Get rid of artificial restriction on hash table sizes on Windows.
- b154ee63bb65 14.0 landed
- 2b8f3f5a7c0e 13.4 landed
- 28d936031a86 15.0 landed