Re: New thoughts about indexing cross-type comparisons

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: New thoughts about indexing cross-type comparisons
Date: 2003-09-17 19:03:03
Message-ID: 4628.1063825383@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org> writes:
> On Wed, 17 Sep 2003, Tom Lane wrote:
>> So I'm beginning to think that avoiding cross-type operators is not the
>> right route to a solution anyway. It may be better to leave the parser
>> alone and teach the planner how to switch to the alternate
>> representation when and where appropriate.

> Yes, and the planner needs information about what alternative
> representations there are (which is the same as letting the planner insert
> coercions and selecting what == operator to use, or are you thinking of
> something else).

Right. My pg_amsecop catalog proposal of yesterday could be seen as
providing knowledge about valid/useful transformations of this form
(ignoring the linkage to index opclasses, which I now see to be
possibly irrelevant).

> Another problem is of course if one let the planner do too much work and
> have to many possible plans to choose from, it has to be fast.

I don't think it's a big problem; this would add at most one catalog
lookup in each situation where an indexed column is compared to
something of a different type. And the plans involved would usually
be ones we'd want to find, I think.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Brown 2003-09-17 20:04:28 Re: New thoughts about indexing cross-type comparisons
Previous Message Dennis Bjorklund 2003-09-17 18:31:07 Re: New thoughts about indexing cross-type comparisons