On Mon, 28 Oct 2024 at 21:51, Andrei Lepikhov <lepi...@gmail.com> wrote: > Having remembered that SQL Server uses lightweight threads to execute > massive hash and aggregate operations in parallel, I think this patch is > promising. Unfortunately, it causes SEGFAULT on 'make check'.
Thanks for having a look. The crash is because I'd not quite gotten around to adjusting this to account for the changes made in 9ca67658d yet. Without adjustment, the ExprState evaluation code would be looking at an uninitialised location to store the intermediate hash value. I've attached an updated patch with a few other fixes. Whilr checking this tonight, noticed that master does not use SubPlanState.tab_eq_funcs for anything. I resisted removing that in this patch. Perhaps a follow-on patch can remove that. I suspect it's not been used for a long time now, but I didn't do the archaeology work to find out. David
v2-0001-Use-ExprStates-for-hashing-in-GROUP-BY-and-SubPla.patch
Description: Binary data