PostGIS 3.5.2 ST_Contains() query on gist is slow
Paul Ramsey
pramsey at cleverelephant.ca
Wed Sep 10 09:05:38 PDT 2025
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 <postgis-users at lists.osgeo.org> wrote:
>
> Why would I want to drop the idx_nodes_geom? Or did you mean the btree_gist (ix_id_nodes_geom)?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20250910/fcaf9071/attachment.htm>
More information about the postgis-users
mailing list