Spatial index tuning for large geometry sets
GiST indexes degrade when geometries vary widely in size — small points mixed with large polygons produce unbalanced trees and slow nearest-neighbour queries. We analyse geometry size distributions, split mixed-type tables, tune fillfactor and clustering on the spatial index, and benchmark query plans with EXPLAIN (ANALYZE, BUFFERS) before and after.