PostGIS 3.5.2 ST_Contains() query on gist is slow

Paul Ramsey pramsey at cleverelephant.ca
Tue Sep 9 10:25:12 PDT 2025


On Mon, Sep 8, 2025 at 8:34 PM Sebastiaan Couwenberg via postgis-users <
postgis-users at lists.osgeo.org> wrote:

>  may be a regression in PostGIS 3.5.2, but I'm at a loss on how to confirm
> and fix that.
>
>
So, this seems to be a change in planning behaviour primarily, and you have
a lot of variability in your upgrade, any piece of which could be
implicated:

- Have you run ANALYZE on the relevant tables?
- You have a PostgreSQL upgrade from 15 to 17, can you hold your
PostGIS version constant while testing PostgreSQL version changes
- You have a PostGIS upgrade from 3.3 to 3.5, can you hold your PostgreSQL
version constant while testing PostGIS version changes
- Can you check the PostGIS selectivity estimate on the old and the new
installations, using

SELECT  _postgis_selectivity ('nodes', 'geom',
ST_GeomFromEWKT('SRID=4326;POLYGON((6.11982 52.6121955,6.11982
53.2038323,7.0927397 53.2038323,7.0927397 52.6121955,6.11982
52.6121955))'), '2');

P
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20250909/f2365a23/attachment.htm>


More information about the postgis-users mailing list