[postgis-tickets] [PostGIS] #4750: Performance issue with computed columns

PostGIS trac at osgeo.org
Sat Sep 5 14:29:06 PDT 2020


#4750: Performance issue with computed columns
----------------------+---------------------------
  Reporter:  robe     |      Owner:  pramsey
      Type:  defect   |     Status:  new
  Priority:  high     |  Milestone:  PostGIS 3.0.3
 Component:  postgis  |    Version:  3.0.x
Resolution:           |   Keywords:
----------------------+---------------------------

Comment (by robe):

 I think I may have found the culprit.  I suspect our postgis_addbbox
 doesn't get run for computed columns.  So to prove I did this:


 {{{
 ALTER TABLE test.co_random_points
     ADD way_buffer_cbox GEOMETRY (POLYGON, 3857)
     GENERATED ALWAYS AS (postgis_AddBBox(ST_Buffer(ST_Transform(way_4326,
 3857), 500)) ) STORED ;

 CREATE INDEX ix_random_points_way_buffer_cbox_gist ON
 test.co_random_points
     USING GIST (way_buffer_cbox);

 -- 1 secs 208 msec.
 SELECT COUNT(p.*)
     FROM test.co_random_points p
     INNER JOIN test.co_road_line r
         ON ST_Contains(p.way_buffer_cbox, r.way)
     ;

 }}}

 Comparable to what you get with the manual as expected

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4750#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