[postgis-tickets] [PostGIS] #5186: PostGIS performance regressions on identical queries

PostGIS trac at osgeo.org
Mon Jul 18 03:32:17 PDT 2022


#5186: PostGIS performance regressions on identical queries
----------------------+---------------------------
  Reporter:  dracos   |      Owner:  pramsey
      Type:  defect   |     Status:  new
  Priority:  medium   |  Milestone:  PostGIS 3.2.2
 Component:  postgis  |    Version:  3.1.x
Resolution:           |   Keywords:
----------------------+---------------------------
Comment (by robe):

 at a glance key thing I am seeing is the index condition

 PG 13 appears to use an index for @ (which I suspect comes from
 ST_Coveredby support function)
 {{{
   ->  Index Scan using postcodes_postcode_location_id on mapit_postcode
 (cost=50.41..108.43 rows=1 width=43) (actual time=9843.065..9843.065
 rows=1 loops=1)
          Index Cond: ((location @ st_transform($0, 4326)) AND (location &&
 st_transform($1, 4326)))
          Filter: st_coveredby(location, st_transform($0, 4326))
 }}}

 compared to PG 12


 {{{
    ->  Index Scan using postcodes_postcode_location_id on mapit_postcode
 (cost=0.66..849.44 rows=62 width=43) (actual time=32.080..32.080 rows=1
 loops=1)
          Index Cond: (location && st_transform($1, 4326))
          Filter: st_coveredby(location, st_transform($0, 4326))
 }}}

 My guess is the @ is being picked up before the && and is costlier, though
 I wouldn't expect it to be that much more costly.
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5186#comment:1>
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