Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#2770 closed enhancement (fixed)

Implement ST_MemSize(raster)

Reported by: strk Owned by: strk
Priority: medium Milestone: PostGIS 2.2.0
Component: raster Version: trunk
Keywords: history Cc:

Description

To go togheter with ST_MemSize(geometry) -- and see #2769

Change History (8)

comment:1 Changed 5 years ago by strk

Committed as r12630 -- but I hadn't added documentation. Can you help with that robe ? I'd just point it to the geometry version...

comment:2 Changed 5 years ago by strk

Keywords: history added
Milestone: PostGIS 2.2.0
Owner: changed from pramsey to strk
Status: newassigned
Type: defectenhancement
Version: 2.1.xtrunk

comment:3 Changed 5 years ago by strk

Component: postgisraster

comment:4 Changed 5 years ago by strk

Tests for the new function seem to be unstable, see #2771

comment:5 Changed 5 years ago by robe

okay

comment:6 Changed 5 years ago 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.

comment:7 Changed 5 years ago by robe

Resolution: fixed
Status: assignedclosed

update docs at r12534. I'm going to close this out and open up the pg_column_size discrepancy as a separate ticket which dustymugs can swiftly close if he feels this is an expected change.

comment:8 Changed 5 years ago by robe

nevermind my diatribe, I just realized I had a typo in my example and pg_column_size and ST_MemSize do return the same answer for raster. I had a typo pg_column_size(ST_MemSize...) doh.

Note: See TracTickets for help on using tickets.