Because the core of your query is “find this small handful of records that meet the unique key constraints, and then filter them with ST_Contains”, and that query cannot make use of the spatial index, so for that query the index is superfluous. You might have other queries that *do* need the index, but the one you’re getting the bad plan on does not.
P > On Sep 10, 2025, at 8:21 AM, Sebastiaan Couwenberg via postgis-users > <[email protected]> wrote: > > Why would I want to drop the idx_nodes_geom? Or did you mean the btree_gist > (ix_id_nodes_geom)?
