[postgis-tickets] [PostGIS] #3864: Sorting by geometry is slower than sorting by geohash

PostGIS trac at osgeo.org
Tue Oct 3 22:58:55 PDT 2017


#3864: Sorting by geometry is slower than sorting by geohash
----------------------+---------------------------
  Reporter:  komzpa   |      Owner:  pramsey
      Type:  defect   |     Status:  new
  Priority:  medium   |  Milestone:  PostGIS 2.4.1
 Component:  postgis  |    Version:  2.3.x
Resolution:           |   Keywords:
----------------------+---------------------------

Comment (by komzpa):

 I cannot confirm that polygon data sort is faster, too, although the
 difference is 7%, not 20 as in point case:

 {{{
 [local] gis at gis=# create table juno_osm_polygon_pt1 as (select * from
 juno_osm_polygon_unclustered order by
 ST_GeoHash(ST_Transform(ST_Envelope(way),4326),10) COLLATE "C");
 SELECT 9936051
 Time: 211660,739 ms (03:31,661)
 [local] gis at gis=# create table juno_osm_polygon_pt2 as (select * from
 juno_osm_polygon_unclustered order by way);
 SELECT 9936051
 Time: 226570,568 ms (03:46,571)
 [local] gis at gis=# create table juno_osm_polygon_pt3 as (select * from
 juno_osm_polygon_unclustered order by way::bytea);
 SELECT 9936051
 Time: 187295,132 ms (03:07,295)
 }}}

 This SELECT form is used in osm2pgsql workflow.

 I've tried to have a look at what can be done for points in
 https://github.com/postgis/postgis/pull/146

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