Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 015599FB543 for ; Wed, 15 Aug 2007 16:32:03 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 55939-07 for ; Wed, 15 Aug 2007 16:31:54 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.184]) by postgresql.org (Postfix) with ESMTP id B8F0D9FB52C for ; Wed, 15 Aug 2007 16:31:57 -0300 (ADT) Received: by nf-out-0910.google.com with SMTP id f5so22647nfh for ; Wed, 15 Aug 2007 12:31:56 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=qZ35GPBYiv129YleGpHuPoH9K8uRsUTf2QLay3cUmR+ZxkN4TEXtRkpjrpSZccz/nrlbDOkCTZ+m5Wmf7LFV5i7f817awIFhEFzVA8fNgQDySlUUhhscnPZD4z76qN4L2V1rlptLgNLf5fQIUshPSfpNkjU9boYgCjFD6a7Xur0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=UXzw41B3c3iU1x2fh6UksC2GjJf+UlG7XZoU1t1XA+QKf3wicC7s3HtOmreWxy9MZcQCHOw0FINsxinQlREBcXo2enrA0M/sgjVY6+VCCCQ+ooGuEFHFjzBqi6TkEOFeQL4/1GY7Mx9/zU6DyazdVv+Gz4nQg1AmJnbASqoV34o= Received: by 10.86.95.20 with SMTP id s20mr656621fgb.1187206304684; Wed, 15 Aug 2007 12:31:44 -0700 (PDT) Received: from ?192.168.0.100? ( [80.222.48.97]) by mx.google.com with ESMTPS id d13sm4468579fka.2007.08.15.12.31.42 (version=SSLv3 cipher=RC4-MD5); Wed, 15 Aug 2007 12:31:42 -0700 (PDT) Message-ID: <46C3548C.90100@enterprisedb.com> Date: Wed, 15 Aug 2007 20:31:24 +0100 From: Heikki Linnakangas User-Agent: Icedove 1.5.0.10 (X11/20070329) MIME-Version: 1.0 To: Dawid Kuroczko CC: pgsql-hackers@postgresql.org Subject: Re: Index Tuple Compression Approach? References: <604pj1n777.fsf_-_@dba2.int.libertyrms.com> <758d5e7f0708150610j3e6ee948i760d01b91ca29c81@mail.gmail.com> <758d5e7f0708150939w1a08590aw1abcfcde402122df@mail.gmail.com> In-Reply-To: <758d5e7f0708150939w1a08590aw1abcfcde402122df@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/543 X-Sequence-Number: 106465 Dawid Kuroczko wrote: > Some time ago I've had an idea that it might be possible to compress > th index size, even if it is a unique index. Take the path example. > My idea would be to to split indexed value to 8-byte chunks. > For example: /var/lib/postgresql/8.2/main would be split into: > "/var/lib" > "/postgre" > "sql/8.2" -- these would be insertered into a tree as a "scaffold", > and only vacuum should remove them.. > "main" -- this would be a leaf node. It could be repeated in non-unique > indexes. 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. It's been discussed before. One big problem is extracting the common leading part. You could only do it for text, but it should be done in a datatype neutral way. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com