[PostGIS] #5984: PostGIS selectivity is screwing up queries and forcing it to choose a spatial index when it's inappropriate

PostGIS trac at osgeo.org
Fri Sep 26 07:22:58 PDT 2025


#5984: PostGIS selectivity is screwing up queries and forcing it to choose a
spatial index when it's inappropriate
-----------------------+---------------------------
  Reporter:  robe      |      Owner:  pramsey
      Type:  defect    |     Status:  new
  Priority:  critical  |  Milestone:  PostGIS 3.4.5
 Component:  postgis   |    Version:  3.5.x
Resolution:            |   Keywords:
-----------------------+---------------------------
Comment (by Bas Couwenberg):

 Replying to [comment:10 robe]:
 > Anyway Bas can you run this query in your bad db
 >
 > {{{
 > SELECT _postgis_stats('nodes', 'geom','2') ;
 > }}}

 Appologies for the delay, I was hiking in Canada and unable to access my
 systems at home:

 {{{
 osm-nl=# SELECT _postgis_stats('nodes', 'geom','2') ;
 _postgis_stats
 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 {"ndims":2,"size":[-2147483648,-2147483648],"extent":{"min":[3.35895,50.727],"max":[7.23809,53.8012]},"table_features":133223520,"sample_features":30000,"not_null_features":30000,"histogram_features":30000,"histogram_cells":0,"cells_covered":0}
 (1 row)
 }}}
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5984#comment:14>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list