[postgis-tickets] [PostGIS] #3344: Unnecessary use of table/possible speed improvement

PostGIS trac at osgeo.org
Wed Oct 21 14:12:05 PDT 2015


#3344: Unnecessary use of table/possible speed improvement
-------------------------+---------------------
 Reporter:  postgispaul  |      Owner:  pramsey
     Type:  enhancement  |     Status:  new
 Priority:  medium       |  Milestone:
Component:  postgis      |    Version:  2.1.x
 Keywords:               |
-------------------------+---------------------
 Situation:
 - table polygons with geomety and a nameid
 - table names with id and name

 query-plan for
 SELECT st_extent(geometry) FROM polygons
 gives me a sequential scan over the polygons table

 but the query-plan for

 SELECT st_extent(geometry)
 FROM polygons
 LEFT JOIN names ON names.id=polygons.nameid

 gives me a sequential scan over polygons and after that a nested loop
 fetching the name from the names table.

 This last step seems really superfluous as the extent doesn't change if a
 left join is involved or not.

 This is particularly annoying when using postgresql/postgis with qgis if
 the left join is against a slow source, because qgis often does a SELECT
 st_extent

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