From: Heikki Linnakangas <hlinnakangas@vmware.com>
To: Teodor Sigaev <teodor@sigaev.ru>
To: Pgsql Hackers <pgsql-hackers@postgresql.org>
Subject: Re: compress method for spgist - 2
Date: Fri, 5 Dec 2014 15:23:48 +0200
Message-ID: <5481B1E4.60606@vmware.com> (raw)
In-Reply-To: <547C62AF.2050207@sigaev.ru>
References: <547C62AF.2050207@sigaev.ru>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: hlinnakangas@vmware.com, teodor@sigaev.ru
Subject: Re: compress method for spgist - 2
In-Reply-To: <5481B1E4.60606@vmware.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox