Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 68E089FA63A for ; Wed, 15 Aug 2007 17:54:34 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 34683-05 for ; Wed, 15 Aug 2007 17:54:21 -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 5F3F79FA528 for ; Wed, 15 Aug 2007 17:54:24 -0300 (ADT) Received: from localhost ([127.0.0.1] helo=oxford.xeocode.com) by oxford.xeocode.com with esmtp (Exim 4.67) (envelope-from ) id 1ILPsf-0001An-PG; Wed, 15 Aug 2007 21:54:17 +0100 To: "Heikki Linnakangas" Cc: "Dawid Kuroczko" , Subject: Re: Index Tuple Compression Approach? In-Reply-To: <46C3548C.90100@enterprisedb.com> (Heikki Linnakangas's message of "Wed\, 15 Aug 2007 20\:31\:24 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Draft-From: ("nnimap+mail01.enterprisedb.com:INBOX.hackers" 12354) References: <604pj1n777.fsf_-_@dba2.int.libertyrms.com> <758d5e7f0708150610j3e6ee948i760d01b91ca29c81@mail.gmail.com> <758d5e7f0708150939w1a08590aw1abcfcde402122df@mail.gmail.com> <46C3548C.90100@enterprisedb.com> From: Gregory Stark Organization: EnterpriseDB Date: Wed, 15 Aug 2007 21:54:17 +0100 Message-ID: <87bqd8y0w6.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/548 X-Sequence-Number: 106470 "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? > It's been discussed before. One big problem is extracting the common > leading part. You could only do it for text, Or for multi-column indexes I could see this being especially useful if you have some columns in the index key which are small and some that are quite large. So if you have an event table with an index on you wouldn't have to store lots of timestamps on the upper level tree nodes. You would only store them for the leaf nodes. > but it should be done in a datatype neutral way. I wonder if there's an analogous operation for other data types though. Numeric could store the a value relative to the parent value. Arrays could store only the elements needed. bytea of course works just as well as text (or better in the face of i18n). -- Gregory Stark EnterpriseDB http://www.enterprisedb.com