Re: Planner issue

From: Soroosh Sardari <soroosh(dot)sardari(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Planner issue
Date: 2013-10-14 15:41:02
Message-ID: CAFUsPDb8fFS_TXcFJTwkqNnAK7_N22AtgFLQhQo8dbFtQowcHg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Oct 14, 2013 at 10:55 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Soroosh Sardari <soroosh(dot)sardari(at)gmail(dot)com> writes:
> > I developed a new character string type, named myvarchar.
> > Also an operator class for btree is added.
> > PROBLEM:
> > When I executed a query with where clause on 'mine' column, PG does not
> use
> > index.
>
> Most likely you got the opclass definition wrong. Since you've shown us
> no details of what you did, it's hard to speculate about just how. But
> note that varchar itself is a pretty bad model for a user-added datatype,
> because it has a special symbiotic relationship with type "text" (to wit,
> it has no operators of its own but uses text's operators via implicit
> casts). To get to a working independent datatype like this, you'd need
> to pick the right aspects of each of text and varchar to clone. So my
> unfounded speculation is you didn't do that just right.
>
> regards, tom lane
>

As Tom said, I did something wrong when I was creating new operators.
The RESTRICT parameter is forgotten. Since all varchar operations
redirected to text operators, hence my operators must be like
operators of type text.

I used following command to find text operator:

select * from pg_operator where oprleft = 25
and oprright = 25

P.S : 25 is oid of text type.

Cheers,
Soroosh Sardari

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-10-14 15:50:44 Re: dynamic shared memory
Previous Message Amit Kapila 2013-10-14 15:26:44 Re: Long paths for tablespace leads to uninterruptible hang in Windows