From: Regina Obe Date: Mon, 17 Nov 2008 17:30:53 +0000 (+0000) Subject: amend ST_Mem_Size X-Git-Tag: 1.4.0b1~501 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=69ad2ffadaf765b8f8b8bc4b4d525371d723e78c;p=postgis amend ST_Mem_Size git-svn-id: http://svn.osgeo.org/postgis/trunk@3300 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/reference_new.xml b/doc/reference_new.xml index 64ee2bc59..653f36319 100644 --- a/doc/reference_new.xml +++ b/doc/reference_new.xml @@ -10629,9 +10629,11 @@ SELECT ST_SetSRID(ST_Extent(the_geom),2249) as bextent FROM sometable; Description Returns the amount of space (in bytes) the geometry takes. - This is a nice compliment to PostgreSQL built in functions pg_size_pretty, pg_relation_size. - pg_relation_size which gives the full size of a table may return byte size lower than ST_Mem_Size. This is because - pg_relation_size does not add toasted table contribution where large geometries are stored. + This is a nice compliment to PostgreSQL built in functions pg_size_pretty, pg_relation_size, pg_total_relation_size. + pg_relation_size which gives the byte size of a table may return byte size lower than ST_Mem_Size. This is because + pg_relation_size does not add toasted table contribution and large geometries are stored in TOAST tables. + pg_total_relation_size - includes, the table, the toasted tables, and the indexes. + @@ -10670,6 +10672,13 @@ SELECT ST_Mem_Size(ST_GeomFromText('CIRCULARSTRING(220268 150415,220227 150505,2 --- 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 +FROM neighborhoods; +fulltable_size geomsize pergeom +------------------------------------------------ +262144 96238 36.71188354492187500000