Re: Operator class group proposal - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Operator class group proposal
Date
Msg-id 26149.1166810817@sss.pgh.pa.us
Whole thread Raw
In response to Re: Operator class group proposal  (Gregory Stark <stark@enterprisedb.com>)
Responses Re: Operator class group proposal  (Gregory Stark <gsstark@mit.edu>)
List pgsql-hackers
Gregory Stark <stark@enterprisedb.com> writes:
> I thought that would just be formalizing what we currently have. But I just
> discovered to my surprise tat it's not. I don't see any cross-data-type
> operators between any of the integer types and numeric, or between any of the
> floating point types and numeric, or between any of the integers and the
> floating point types.

Correct.

> So does that mean we currently have three separate arithmetic "operator class
> groups" such as they currently exist and you can't currently do merge joins
> between some combinations of these arithmetic types?

No, what you'll get is something like
int4var::float8 float8eq float8var

which is perfectly mergejoinable ... however, it's not clear that the
planner will make very good estimates about the value of the cast
expression.  I'm not sure if it's worth introducing a pile more
crosstype operators to change that situation --- improving
the selectivity functions to handle casts better might be a wiser
approach.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Companies Contributing to Open Source
Next
From: Tom Lane
Date:
Subject: Re: recent --with-libxml support