Re: create opclass documentation outdated - Mailing list pgsql-hackers

From Emre Hasegeli
Subject Re: create opclass documentation outdated
Date
Msg-id CAE2gYzx4rg3oKHVeP2pPh5eCn+f5GxF1mSRUdEOoanEyr3N=hA@mail.gmail.com
Whole thread Raw
In response to Re: create opclass documentation outdated  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: create opclass documentation outdated
List pgsql-hackers
>> In create_opclass.sgml, not only do we have the list of AMs supporting
>> STORAGE, but there is also a paragraph describing which AMs do what
>> for input datatypes of FUNCTION members (around line 175).
>
> I placed BRIN together with gist/gin/spgist here, namely that the optype
> defaults to the opclass' datatype.

Requiring STORAGE type for BRIN opclasses is more of a bug than a
feature.  None of the operator classes actually support storing values
with different type.  We had intended to support it for inclusion
opclass to index points by casting them to box, but then ripped it out
because of inconsistencies on the operators caused by floating point
arithmetics.

The problem is that the operator classes try to query the strategies
using the datatype they got from TupleDesc structure.  It fails at
least for cidr, because it is casted implicitly and indexed as inet.
All of the BRIN operator classes can fail the same way for user
defined types.  Adding STORAGE to all operator classes have seemed to
me like an easy fix at the time I noticed this problem, but what we
really need to do is to fix this than document.  We should to make
BRIN use the datatype of the operator class as btree does.

> +   of each operator class interpret the strategy nnumbers according to the

Typo: nnumbers.

> +   Operator classes based on the <literal>Inclusion</> framework can
> +   theoretically support cross-data-type operations, but there's no
> +   demonstrating implementation yet.

This part of the inclusion class is not committed, so this paragraph
shouldn't be there.

Other than those, the changes look good to me.



pgsql-hackers by date:

Previous
From: konstantin knizhnik
Date:
Subject: Re: Optimizer questions
Next
From: Robert Haas
Date:
Subject: Re: Freeze avoidance of very large table.