[postgis-tickets] [PostGIS] #2933: Speed up ST_GeomFromWKB

PostGIS trac at osgeo.org
Thu Sep 18 11:52:32 PDT 2014


#2933: Speed up ST_GeomFromWKB
-------------------------+--------------------------------------------------
 Reporter:  strk         |       Owner:  pramsey
     Type:  enhancement  |      Status:  new    
 Priority:  medium       |   Milestone:         
Component:  postgis      |     Version:  trunk  
 Keywords:               |  
-------------------------+--------------------------------------------------

Comment(by pramsey):

 Nevermind, I made a synthetic one. But I'm not seeing the same kind of
 behaviour.
 {{{
 -- make a 10M point linestring
 create table bigassgeom as
   select
     1 as id,
     st_makeline(st_setsrid(st_makepoint(random()*10000,
 random()*10000),26910)) as geom
   from generate_series(1,10000000);

 -- how long is a basic access?
 select st_numpoints(geom) from bigassgeom;
 -- about 190ms

 -- how long is an output to wkb?
 select length(st_asbinary(geom)) from bigassgeom;
 -- about 380ms

 -- how long is a roundtrip through wkb?
 select st_numpoints(st_geomfromwkb(st_asbinary(geom))) from bigassgeom;
 -- about 850ms
 }}}
 So, parsing takes maybe 3-4 times as long as outputting, which seems fair,
 since it has to build structure on the way in, which doesn't happen on the
 way out. Also I'm not seeing anything like a 10s timing on anything, how
 big *are* these geometries you're producing?

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2933#comment:5>
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