Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 9589B9F9933 for ; Thu, 16 Aug 2007 04:48:41 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 02873-02 for ; Thu, 16 Aug 2007 04:48:35 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from oxford.xeocode.com (unknown [87.127.95.194]) by postgresql.org (Postfix) with ESMTP id A1EF89F976F for ; Thu, 16 Aug 2007 04:48:35 -0300 (ADT) Received: from localhost.enta.net ([127.0.0.1] helo=oxford.xeocode.com) by oxford.xeocode.com with esmtp (Exim 4.67) (envelope-from ) id 1ILa5n-0001bY-Vm; Thu, 16 Aug 2007 08:48:32 +0100 To: "Heikki Linnakangas" Cc: "Dawid Kuroczko" , Subject: Re: Index Tuple Compression Approach? In-Reply-To: <46C3F320.1010809@enterprisedb.com> (Heikki Linnakangas's message of "Thu\, 16 Aug 2007 07\:48\:00 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Draft-From: ("nnimap+mail01.enterprisedb.com:INBOX" 31907) References: <604pj1n777.fsf_-_@dba2.int.libertyrms.com> <758d5e7f0708150610j3e6ee948i760d01b91ca29c81@mail.gmail.com> <758d5e7f0708150939w1a08590aw1abcfcde402122df@mail.gmail.com> <46C3548C.90100@enterprisedb.com> <87bqd8y0w6.fsf@oxford.xeocode.com> <46C3F320.1010809@enterprisedb.com> From: Gregory Stark Organization: EnterpriseDB Date: Thu, 16 Aug 2007 08:48:31 +0100 Message-ID: <873ayjyl68.fsf@oxford.xeocode.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/555 X-Sequence-Number: 106477 "Heikki Linnakangas" writes: > Gregory Stark wrote: >> "Heikki Linnakangas" writes: >> >>> That general approach of storing a common part leading part just once is >>> called prefix compression. Yeah, it helps a lot on long text fields. >>> Tree structures like file paths in particular. >> >> You kind of want to do avoid both the prefix and the suffix, no? > > You're much more likely to find common prefixes than suffixes in an > index page, because of the ordering. I suppose compressing the suffix > would be useful in some cases as well. You might be better off with some > generic compression algorithm at that point, though. Sorry, by "suffix" I don't mean common sufixes, I mean the bits of the key following the point which discriminates between the left and right side of the tree. So for example if you're indexing a text field and have a tree structure like: Redhat Fedora Core 7 / \ Debian Etch (Unstable) Ubuntu hoary We don't really need the whole of "Redhat Fedora Core 7" in the index node. We could actually get by with just "R". Everything before "R" is on the left and everything after "R" is on the right. -- Gregory Stark EnterpriseDB http://www.enterprisedb.com