]> granicus.if.org Git - postgis/commitdiff
#2770 Document new ST_MemSize for raster and #2769 name change for geometry (ST_MEm_S...
authorRegina Obe <lr@pcorp.us>
Sun, 22 Jun 2014 02:51:03 +0000 (02:51 +0000)
committerRegina Obe <lr@pcorp.us>
Sun, 22 Jun 2014 02:51:03 +0000 (02:51 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@12634 b70326c6-7e19-0410-871a-916f4a2858ee

doc/reference_misc.xml
doc/reference_raster.xml

index 2ce96f375d9dc3b7a904f2ca6e79983280126d43..d543be84288e029974611e8884889a0d9b5f8232 100644 (file)
@@ -528,9 +528,9 @@ find_srid
          </refsection>
        </refentry>
 
-       <refentry id="ST_Mem_Size">
+       <refentry id="ST_MemSize">
          <refnamediv>
-               <refname>ST_Mem_Size</refname>
+               <refname>ST_MemSize</refname>
 
                <refpurpose>Returns the amount of space (in bytes) the geometry takes.</refpurpose>
          </refnamediv>
@@ -538,7 +538,7 @@ find_srid
          <refsynopsisdiv>
                <funcsynopsis>
                  <funcprototype>
-                       <funcdef>integer <function>ST_Mem_Size</function></funcdef>
+                       <funcdef>integer <function>ST_MemSize</function></funcdef>
                        <paramdef><type>geometry </type> <parameter>geomA</parameter></paramdef>
                  </funcprototype>
                </funcsynopsis>
@@ -548,16 +548,18 @@ find_srid
                <title>Description</title>
 
                <para>Returns the amount of space (in bytes) the geometry takes. </para>
-               <para>This is a nice compliment to PostgreSQL built in functions pg_size_pretty, pg_relation_size, pg_total_relation_size.</para>
-               <note><para>pg_relation_size which gives the byte size of a table may return byte size lower than ST_Mem_Size. This is because
+               <para>This is a nice compliment to PostgreSQL built in functions pg_column_size, pg_size_pretty, pg_relation_size, pg_total_relation_size.</para>
+               <note><para>pg_relation_size which gives the byte size of a table may return byte size lower than ST_MemSize. This is because
                pg_relation_size does not add toasted table contribution and large geometries are stored in TOAST tables.</para>
                <para>pg_total_relation_size - includes, the table, the toasted tables, and the indexes.</para>
+               <para>pg_column_size returns how much space a geometry would take in a column considering compression, so may be lower than ST_MemSize</para>
                </note>
 
                <para>&Z_support;</para>
                <para>&curve_support;</para>
                <para>&P_support;</para>
                <para>&T_support;</para>
+               <para>Changed: 2.2.0 name changed to ST_MemSize to follow naming convention.  In prior versions this function was called ST_Mem_Size, old name deprecated though still available.</para>
          </refsection>
 
 
@@ -566,10 +568,10 @@ find_srid
 
                <programlisting>
 --Return how much byte space Boston takes up  in our Mass data set
-SELECT pg_size_pretty(SUM(ST_Mem_Size(the_geom))) as totgeomsum,
-pg_size_pretty(SUM(CASE WHEN town = 'BOSTON' THEN st_mem_size(the_geom) ELSE 0 END)) As bossum,
-CAST(SUM(CASE WHEN town = 'BOSTON' THEN st_mem_size(the_geom) ELSE 0 END)*1.00 /
-               SUM(st_mem_size(the_geom))*100 As numeric(10,2)) As perbos
+SELECT pg_size_pretty(SUM(ST_MemSize(the_geom))) as totgeomsum,
+pg_size_pretty(SUM(CASE WHEN town = 'BOSTON' THEN ST_MemSize(the_geom) ELSE 0 END)) As bossum,
+CAST(SUM(CASE WHEN town = 'BOSTON' THEN ST_MemSize(the_geom) ELSE 0 END)*1.00 /
+               SUM(ST_MemSize(the_geom))*100 As numeric(10,2)) As perbos
 FROM towns;
 
 totgeomsum     bossum  perbos
@@ -577,14 +579,14 @@ totgeomsum        bossum  perbos
 1522 kB                30 kB   1.99
 
 
-SELECT ST_Mem_Size(ST_GeomFromText('CIRCULARSTRING(220268 150415,220227 150505,220227 150406)'));
+SELECT ST_MemSize(ST_GeomFromText('CIRCULARSTRING(220268 150415,220227 150505,220227 150406)'));
 
 ---
 73
 
 --What percentage of our table is taken up by just the geometry
-SELECT pg_total_relation_size('public.neighborhoods') As fulltable_size, sum(ST_Mem_Size(the_geom)) As geomsize,
-sum(ST_Mem_Size(the_geom))*1.00/pg_total_relation_size('public.neighborhoods')*100 As pergeom
+SELECT pg_total_relation_size('public.neighborhoods') As fulltable_size, sum(ST_MemSize(the_geom)) As geomsize,
+sum(ST_MemSize(the_geom))*1.00/pg_total_relation_size('public.neighborhoods')*100 As pergeom
 FROM neighborhoods;
 fulltable_size geomsize  pergeom
 ------------------------------------------------
index 4dc25acc0fcf307a0947bdbba8ecde554892bc51..bf2ef4b67dd10d901f149af32d40dceb690b1c53 100644 (file)
@@ -2169,6 +2169,56 @@ t          |
                        </refsection>
                </refentry>
 
+        <refentry id="RT_ST_MemSize">
+         <refnamediv>
+               <refname>ST_MemSize</refname>
+
+               <refpurpose>Returns the amount of space (in bytes) the raster takes.</refpurpose>
+         </refnamediv>
+
+         <refsynopsisdiv>
+               <funcsynopsis>
+                 <funcprototype>
+                       <funcdef>integer <function>ST_MemSize</function></funcdef>
+                       <paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
+                 </funcprototype>
+               </funcsynopsis>
+         </refsynopsisdiv>
+
+         <refsection>
+               <title>Description</title>
+
+               <para>Returns the amount of space (in bytes) the raster takes. </para>
+               <para>This is a nice compliment to PostgreSQL built in functions pg_column_siez, pg_size_pretty, pg_relation_size, pg_total_relation_size.</para>
+               <note><para>pg_relation_size which gives the byte size of a table may return byte size lower than ST_MemSize. This is because
+               pg_relation_size does not add toasted table contribution and large geometries are stored in TOAST tables. pg_column_size might return lower because it returns the compressed size.</para>
+               <para>pg_total_relation_size - includes, the table, the toasted tables, and the indexes.</para>
+               </note>
+
+               <para>Availability: 2.2.0</para>
+         </refsection>
+
+
+         <refsection>
+               <title>Examples</title>
+
+               <programlisting>
+               SELECT ST_MemSize(ST_AsRaster(ST_Buffer(ST_Point(1,5),10,1000),150, 150, '8BUI')) As rast_mem;
+               
+               rast_mem
+               --------
+               22568
+       </programlisting>
+         </refsection>
+
+         <!-- Optionally add a "See Also" section -->
+         <refsection>
+               <title>See Also</title>
+
+               <para></para>
+         </refsection>
+       </refentry>
+       
                <refentry id="RT_ST_MetaData">
                        <refnamediv>
                                <refname>ST_MetaData</refname>