[postgis-tickets] [PostGIS] #2770: Implement ST_MemSize(raster)

PostGIS trac at osgeo.org
Sat Jun 21 19:43:03 PDT 2014


#2770: Implement ST_MemSize(raster)
-------------------------+--------------------------------------------------
 Reporter:  strk         |       Owner:  strk         
     Type:  enhancement  |      Status:  assigned     
 Priority:  medium       |   Milestone:  PostGIS 2.2.0
Component:  raster       |     Version:  trunk        
 Keywords:  history      |  
-------------------------+--------------------------------------------------

Comment(by robe):

 strk and dustymugs,

 Why is the raster mem size so different from pg_column_size.  Might be a
 bug in pg_column_size or we changed something recently in how we are
 storing things.
 For example:

 {{{
 SELECT ST_MemSize(ST_AsRaster(ST_Buffer(ST_Point(1,5),10,1000),150, 150,
 '8BUI')) As mem_rast_size,
 pg_column_size(ST_MemSize(ST_AsRaster(ST_Buffer(ST_Point(1,5),10,1000),150,
 150, '8BUI'))) As col_rast_size
 , ST_MemSize(ST_Buffer(ST_Point(1,5),10,1000)) As mem_geom_size,
 pg_column_size(ST_Buffer(ST_Point(1,5),10,1000)) As col_geom_size;
 }}}


 outputs:
  mem_rast_size | col_rast_size | mem_geom_size | col_geom_size
 ---------------+--------------+---------------+---------------
          22568 |            4 |         64072 |         64072


 I checked the manual and it does say
 http://www.postgresql.org/docs/current/static/functions-admin.html

 as I remember pg_column_size -- Number of bytes used to store a particular
 value (possibly compressed)

 is compression for this case really that good.  I guess its possible since
 it is a fairly simple rasterized geometry.


 I did a quick test on one of my production PostGIS 2.1.2 installs and:


 {{{
 SELECT pg_column_size(ST_AsRaster(ST_Buffer(ST_Point(1,5),10,1000),150,
 150, '8BUI'));
 }}}

 Yields:

 {{{
 22568

 }}}


 So unless we changed something recently in how we are storing something
 seems a bit fishy.

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