Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XwssA-0001zm-7Z for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Dec 2014 13:24:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Xwss9-0003kK-JO for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Dec 2014 13:24:37 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Xwss8-0003kD-Br for pgsql-hackers@postgresql.org; Fri, 05 Dec 2014 13:24:36 +0000 Received: from smtp-outbound-2.vmware.com ([208.91.2.13]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1Xwss1-00047v-9p for pgsql-hackers@postgresql.org; Fri, 05 Dec 2014 13:24:31 +0000 Received: from sc9-mailhost1.vmware.com (sc9-mailhost1.vmware.com [10.113.161.71]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id E8217282F4; Fri, 5 Dec 2014 05:24:26 -0800 (PST) Received: from EX13-CAS-007.vmware.com (EX13-CAS-007.vmware.com [10.113.191.57]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id E492419379; Fri, 5 Dec 2014 05:24:26 -0800 (PST) Received: from EX13-MBX-024.vmware.com (10.113.191.44) by EX13-MBX-012.vmware.com (10.113.191.32) with Microsoft SMTP Server (TLS) id 15.0.913.22; Fri, 5 Dec 2014 05:25:16 -0800 Received: from [192.168.1.90] (10.113.160.246) by EX13-MBX-024.vmware.com (10.113.191.44) with Microsoft SMTP Server (TLS) id 15.0.913.22; Fri, 5 Dec 2014 05:24:15 -0800 Message-ID: <5481B1E4.60606@vmware.com> Date: Fri, 5 Dec 2014 15:23:48 +0200 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.2.0 MIME-Version: 1.0 To: Teodor Sigaev , Pgsql Hackers Subject: Re: compress method for spgist - 2 References: <547C62AF.2050207@sigaev.ru> In-Reply-To: <547C62AF.2050207@sigaev.ru> Content-Type: text/plain; charset="koi8-r"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.113.160.246] X-ClientProxiedBy: EX13-CAS-013.vmware.com (10.113.191.65) To EX13-MBX-024.vmware.com (10.113.191.44) X-Pg-Spam-Score: -6.9 (------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 12/01/2014 02:44 PM, Teodor Sigaev wrote: > > Initial message: > http://www.postgresql.org/message-id/5447B3FF.2080406@sigaev.ru > > Second version fixes a forgotten changes in pg_am. > + /* Get the information we need about each relevant datatypes */ > + > + if (OidIsValid(cache->config.leafType) && cache->config.leafType != atttype) > + { > + if (!OidIsValid(index_getprocid(index, 1, SPGIST_COMPRESS_PROC))) > + ereport(ERROR, > + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), > + errmsg("compress method is not defined although input and leaf types are differ"))); > + > + fillTypeDesc(&cache->attType, cache->config.leafType); > + } > + else > + { > + fillTypeDesc(&cache->attType, atttype); > + } > + For some datatypes, the compress method might be useful even if the leaf type is the same as the column type. For example, you could allow indexing text datums larger than the page size, with a compress function that just truncates the input. Could you find some use for this in one of the built-in or contrib types? Just to have something that exercises it as part of the regression suite. How about creating an opclass for the built-in polygon type that stores the bounding box, like the PostGIS guys are doing? The documentation needs to be updated. - Heikki -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers