Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 9749F1337B64 for ; Thu, 28 Oct 2010 06:33:29 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 03726-06 for ; Thu, 28 Oct 2010 09:33:23 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from 30.mail-out.ovh.net (30.mail-out.ovh.net [213.186.62.213]) by mail.postgresql.org (Postfix) with SMTP id 759FA133798E for ; Thu, 28 Oct 2010 06:33:21 -0300 (ADT) Received: (qmail 8096 invoked by uid 503); 28 Oct 2010 09:12:31 -0000 Received: from b6.ovh.net (HELO mail423.ha.ovh.net) (213.186.33.56) by 30.mail-out.ovh.net with SMTP; 28 Oct 2010 09:12:31 -0000 Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 28 Oct 2010 11:33:19 +0200 Received: from par69-8-88-161-102-87.fbx.proxad.net (HELO apollo13) (lists%peufeu.com@88.161.102.87) by ns0.ovh.net with SMTP; 28 Oct 2010 11:33:17 +0200 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Robert Haas" , "Tom Lane" , "Kevin Grittner" Cc: pgsql-performance@postgresql.org, "Kenneth Marshall" , "Mladen Gogala" Subject: Re: Select count(*), the sequel References: <4CB9D89E.7050701@vmsinfo.com> <20101016184443.GA4993@aart.is.rice.edu> <2091.1288133491@sss.pgh.pa.us> <4CC841140200002500036EA2@gw.wicourts.gov> Date: Thu, 28 Oct 2010 11:33:16 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Pierre C" Message-ID: In-Reply-To: <4CC841140200002500036EA2@gw.wicourts.gov> User-Agent: Opera Mail/10.62 (Linux) X-Ovh-Tracer-Id: 4854035974940526224 X-Ovh-Remote: 88.161.102.87 (par69-8-88-161-102-87.fbx.proxad.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Spam-Check: DONE|U 0.5/N X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201010/532 X-Sequence-Number: 40950 > "Pierre C" wrote: > >> in-page compression > How would that be different from the in-page compression done by > TOAST now? Or are you just talking about being able to make it > more aggressive? > -Kevin Well, I suppose lzo-style compression would be better used on data that is written a few times maximum and then mostly read (like a forum, data warehouse, etc). Then, good candidate pages for compression also probably have all tuples visible to all transactions, therefore all row headers would be identical and would compress very well. Of course this introduces a "small" problem for deletes and updates... Delta compression is : take all the values for a column inside a page, look at the values and their statistical distribution, notice for example that they're all INTs and the values on the page fit between X+n and X-n, store X and only encode n with as few bits as possible for each row. This is only an example, the idea is to exploit the fact that on the same page, all the values of one column often have lots in common. xid values in row headers are a good example of this. TOAST compresses datums, so it performs well on large datums ; this is the opposite, the idea is to compress small tuples by using the reduncancies between tuples.