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 1CFFBD80DD for ; Mon, 10 Oct 2005 09:27:21 -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 83411-10 for ; Mon, 10 Oct 2005 12:27:16 +0000 (GMT) Received: from service-web.de (p15093784.pureserver.info [217.160.106.224]) by svr1.postgresql.org (Postfix) with ESMTP id E090CD7DBE for ; Mon, 10 Oct 2005 09:27:17 -0300 (ADT) Received: from [10.100.1.50] (074-016-066-080.eggenet.de [80.66.16.74]) by service-web.de (Postfix) with ESMTP id C463E200038; Mon, 10 Oct 2005 14:27:20 +0200 (CEST) Message-ID: <434A5E22.9040500@wildenhain.de> Date: Mon, 10 Oct 2005 14:27:14 +0200 From: Tino Wildenhain User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050929) X-Accept-Language: de-DE, de, en-us, en MIME-Version: 1.0 To: Stef Cc: pgsql-performance@postgresql.org Subject: Re: Compression of text columns References: <20051010141721.0bebbaa7@svb.ucs.co.za> In-Reply-To: <20051010141721.0bebbaa7@svb.ucs.co.za> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.071 required=5 tests=[AWL=0.021, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200510/162 X-Sequence-Number: 14930 Stef schrieb: > 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 Well, text columns are automatically compressed via the toast mechanism. This is handled transparently for you.