<b>6.0.0.2447</b>
Simonov Denis 2026.11.05 11:04:51
Improvement: Rewrite hash join hash table for better scalability (#9157)
* Rewrite hash join table as a flat bucket-array structure
The old fixed-size table with per-bucket CollisionList objects degraded on large inner streams: long chains and scattered binary searches over heap-allocated buffers. Dynamic resizing did not help because cardinality estimates for table functions are fixed at 1000, so rehashing either never fired or fired too late.
Collect {hash, position} pairs without any bucket logic, then group them by bucket in a single counting-sort pass once the inner streams are fully read. Size the table from the actual number of entries, never rehash. After build(), a bucket is a contiguous range in a flat per-stream array, sorted by hash, with bucketStart[] holding the boundaries.
Up to 37% faster on large joins, no regressions on small ones, structural memory unchanged.
* Replacing FB_NELEM with std::size
* Refactoring: Moving part of the logic to a Stream.
* Use in-place redistribution for large hash joins
* Multi-pass in-place redistribution. Thanks to @TreeHunter9
* Corrections based on @dimitr review.
* delete untracked files
* Using a fast path for the setup() method
* use HalfStaticArray for temp
* Now, the size of the hash table is determined individually for each stream.
* use tab ident
* Sorting collisions within a bucket preserves the order of entries that have the same hash. This allows `BufferedStream::locate()` to operate in a sequential, rather than random, order when there are multiple duplicates of a single key.

Changed paths:
  M src/jrd/recsrc/HashJoin.cpp