Opened 7 years ago
Last modified 7 years ago
#3864 closed defect
Sorting by geometry is slower than sorting by geohash — at Initial Version
Reported by: | komzpa | Owned by: | pramsey |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.4.1 |
Component: | postgis | Version: | 2.3.x |
Keywords: | Cc: |
Description
`
[local] gis@gis=# create table juno_osm_point_unclustered as (select * from juno_osm_point ORDER BY osm_id);
SELECT 159446335
Time: 601714,217 ms (10:01,714)
[local] gis@gis=# create table juno_osm_point_pt1 as (select * from juno_osm_point_unclustered ORDER BY ST_GeoHash(ST_Transform(ST_Envelope(way),4326),10) COLLATE "C");
SELECT 159446335
Time: 1248105,490 ms (20:48,105)
[local] gis@gis=# create table juno_osm_point_pt2 as (select * from juno_osm_point_unclustered ORDER BY way);
SELECT 159446335
Time: 1287415,365 ms (21:27,415)
`
This may happen as there are some other infrastructure optimizations in string sorting code, like abbreviated key comparsions.