X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 74014D80DD for ; Mon, 10 Oct 2005 09:19:08 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 18910-05 for ; Mon, 10 Oct 2005 12:19:02 +0000 (GMT) Received: from ucsns.ucs.co.za (ucsns.ucs.co.za [196.23.43.2]) by svr1.postgresql.org (Postfix) with ESMTP id 3DADFD9603 for ; Mon, 10 Oct 2005 09:19:04 -0300 (ADT) Received: from ucspost.ucs.co.za (mailgw1.ucs.co.za [196.23.43.253]) by ucsns.ucs.co.za (Postfix) with ESMTP id 88D522BE36 for ; Mon, 10 Oct 2005 14:17:22 +0200 (SAST) Received: from jhb.ucs.co.za (jhb.ucs.co.za [172.31.1.3]) by ucspost.ucs.co.za (Postfix) with ESMTP id 84A6BD9DF5 for ; Mon, 10 Oct 2005 14:17:22 +0200 (SAST) Received: from svb.ucs.co.za (svb.ucs.co.za [172.31.1.148]) by jhb.ucs.co.za (Postfix) with ESMTP id 12DB1977EA for ; Mon, 10 Oct 2005 14:17:22 +0200 (SAST) Date: Mon, 10 Oct 2005 14:17:21 +0200 From: Stef To: pgsql-performance@postgresql.org Subject: Compression of text columns Message-ID: <20051010141721.0bebbaa7@svb.ucs.co.za> X-Mailer: Sylpheed-Claws 1.9.6cvs1 (GTK+ 2.6.10; i486-pc-linux-gnu) User-Agent: sillypheed-claws (anti-aliased) X-Face: +lU/o'$=Zv9%Xjo]Kq[_{n&Kb`f{YEWH4&Y#M]'6BkD?VoWe#*@S\MWyD'I>s:0v4{#\[J]l*?]t2uaO(j$d*77Ca-UHo.tkl2)0$B3Jxww\o:xor]<:*Yfx9Vceh)9I/'2g\RKhGTxIIsR^ke^`LVeZ9ksb*:$kQeR@ X-Operating-System: sid X-X-X: _-^-_ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.145 required=5 tests=[AWL=0.145] X-Spam-Level: X-Archive-Number: 200510/161 X-Sequence-Number: 14929 I have a table in the databases I work with, that contains two text columns with XML data stored inside them. This table is by far the biggest table in the databases, and the text columns use up the most space. I saw that the default storage type for text columns is "EXTENDED" which, according to the documentation, uses up extra space to make possible substring functioning faster. Suppose that the data in those columns are only really ever _used_ once, but may be needed in future for viewing purposes mostly, and I cannot really change the underlying structure of the table, what can I possibly do to maximally reduce the amount of disk space used by the table on disk. (There are no indexes on these two columns.) I've thought about compression using something like : ztext http://www.mahalito.net/~harley/sw/postgres/ but I have to change the table structure a lot and I've already encountered problems unzipping the data again. The other problem with this solution, is that database dumps almost double in size, because of double compression. Any suggestions much appreciated TIA Stefan