Ryan Malloy 347acf0906 Fix GiST union 0-based indexing and palloc size, add 66k benchmark
Two bugs in gist_tle.c caused the && (overlap) operator to return
zero results through the GiST index while sequential scan worked:

1. gist_tle_union read from vector[FirstOffsetNumber] (index 1),
   skipping vector[0] which holds the accumulated union key.
   Every internal node collapsed to a single-entry bounding box.
   Fixed: seed from vector[0], loop from 1.

2. All GiST key allocations used sizeof(tle_orbital_key) (32 bytes)
   or sizeof(pg_tle) (104 bytes), but INTERNALLENGTH is 112.
   index_form_tuple() copies typlen bytes, causing buffer overread.
   Fixed: TLE_TYPLEN constant (112) for all index datum allocations.

The <-> (KNN distance) operator was unaffected because it uses
gist_tle_distance, not gist_tle_consistent.

Verified against 66,440-object catalog:
- && consistency: 9 seqscan == 9 GiST (ISS conjunction)
- <-> KNN: 10 nearest in 2.1ms via index-ordered scan
- All 15 regression tests pass
2026-02-18 11:22:07 -07:00
..