postgresql/src/backend
David Rowley d96d1d5152 Fix incorrect slot type in BuildTupleHashTableExt
0f5738202 adjusted the execGrouping.c code so it made use of ExprStates to
generate hash values.  That commit made a wrong assumption that the slot
type to pass to ExecBuildHash32FromAttrs() is always &TTSOpsMinimalTuple.
That's not the case as the slot type depends on the slot type passed to
LookupTupleHashEntry(), which for nodeRecursiveunion.c, could be any of
the current slot types.

Here we fix this by adding a new parameter to BuildTupleHashTableExt()
to allow the slot type to be passed in.  In the case of nodeSubplan.c
and nodeAgg.c the slot type is always &TTSOpsVirtual, so for both of
those cases, it's beneficial to pass the known slot type as that allows
ExecBuildHash32FromAttrs() to skip adding the tuple deform step to the
resulting ExprState.  Another possible fix would have been to have
ExecBuildHash32FromAttrs() set "fetch.kind" to NULL so that
ExecComputeSlotInfo() always determines the EEOP_INNER_FETCHSOME is
required, however, that option isn't favorable as slows down aggregation
and hashed subplan evaluation due to the extra (needless) deform step.

Thanks to Nathan Bossart for bisecting to find the offending commit
based on Paul's report.

Reported-by: Paul Ramsey <pramsey@cleverelephant.ca>
Discussion: https://postgr.es/m/99F064C1-B3EB-4BE7-97D2-D2A0AA487A71@cleverelephant.ca
2024-12-18 12:05:55 +13:00
..
access Count pages set all-visible and all-frozen in VM during vacuum 2024-12-17 14:19:13 -05:00
archive Apply more quoting to GUC names in messages 2024-09-04 13:50:44 +09:00
backup Clean up newlines following left parentheses 2024-11-26 17:10:07 +01:00
bootstrap Set max_safe_fds whenever we create shared memory and semaphores. 2024-12-17 12:23:26 -05:00
catalog Update comments about index parallel builds 2024-12-17 15:40:07 +01:00
commands Print out error position for some more DDLs 2024-12-17 09:44:06 +09:00
executor Fix incorrect slot type in BuildTupleHashTableExt 2024-12-18 12:05:55 +13:00
foreign Improve style of two code paths 2024-10-08 10:51:20 +09:00
jit Require sizeof(bool) == 1. 2024-11-28 12:01:14 +13:00
lib Accommodate very large dshash tables. 2024-12-17 15:24:45 -06:00
libpq Deprecate MD5 passwords. 2024-12-02 13:30:07 -06:00
main Set the stack_base_ptr in main(), not in random other places. 2024-12-17 12:08:42 -05:00
nodes Remove useless casts to (void *) 2024-11-28 08:27:20 +01:00
optimizer Update comments about index parallel builds 2024-12-17 15:40:07 +01:00
parser Print out error position for some more DDLs 2024-12-17 09:44:06 +09:00
partitioning Remove useless casts to (void *) 2024-11-28 08:27:20 +01:00
po Translation updates 2024-06-24 13:11:27 +02:00
port Remove useless casts to (void *) 2024-11-28 08:27:20 +01:00
postmaster Set the stack_base_ptr in main(), not in random other places. 2024-12-17 12:08:42 -05:00
regex Remove pg_regex_collation 2024-12-05 07:19:37 +01:00
replication Rewrite maybe_reread_subscription() comment 2024-12-13 07:41:36 +01:00
rewrite Remove useless casts to (void *) 2024-11-28 08:27:20 +01:00
snowball Remove ts_locale.c's lowerstr() 2024-12-17 14:04:55 +01:00
statistics Use in-place updates for pg_restore_relation_stats(). 2024-12-10 16:30:37 -08:00
storage Remove EXTENSION_DONT_CHECK_SIZE from md.c. 2024-12-14 21:52:10 +13:00
tcop Set max_safe_fds whenever we create shared memory and semaphores. 2024-12-17 12:23:26 -05:00
tsearch Remove ts_locale.c's lowerstr() 2024-12-17 14:04:55 +01:00
utils Skip useless calculation of join RTE column names during EXPLAIN. 2024-12-17 15:52:12 -05:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
Makefile Fix make build on MinGW 2024-06-21 08:17:23 +02:00
meson.build meson: Fix import library name in Windows 2024-06-20 09:08:36 +02:00
nls.mk Add missing gettext triggers 2024-05-14 12:57:22 +02:00