Re: Proposed new create command, CREATE OPERATOR CLASS - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Proposed new create command, CREATE OPERATOR CLASS
Date
Msg-id 10397.1004375935@sss.pgh.pa.us
Whole thread Raw
In response to Re: Proposed new create command, CREATE OPERATOR CLASS  (Oleg Bartunov <oleg@sai.msu.su>)
List pgsql-hackers
Oleg Bartunov <oleg@sai.msu.su> writes:
> this is interesting question - do we really need commutator to get
> postgres to use index. This is the only reason we created  ~~ operator.

AFAIR there is not a requirement to have a commutator link.  However
the indexable operation has to be framed as "indexedvar OP constant".
If the natural way to write it is as "constant OP indexedvar" then
you won't get an indexscan unless it can be commuted to the other way.
The same issue arises if you think that the operator might be useful
in joins.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Sean K. Sell"
Date:
Subject: External Database Connection
Next
From: Tom Lane
Date:
Subject: Re: [patch] helps fe-connect.c handle -EINTR more gracefully