<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">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.<div><br></div><div>P<br id="lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Sep 10, 2025, at 8:21 AM, Sebastiaan Couwenberg via postgis-users <postgis-users@lists.osgeo.org> wrote:</div><br class="Apple-interchange-newline"><div><span style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">Why would I want to drop the idx_nodes_geom? Or did you mean the btree_gist (ix_id_nodes_geom)?</span><br style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"></div></blockquote></div><br></div></body></html>