Re: optimizing impossible matches

From: "Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: optimizing impossible matches
Date: 2004-03-10 17:16:06
Message-ID: 6EE64EF3AB31D5448D0007DD34EEB34101AD87@Herge.rcsinc.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> The optimizer has no knowledge of specific operators except what it
> finds in the system catalogs. It has no way in general to determine
> that a comparison involving nonconstant values must always fail.
> Even if we could do it, I am dubious that it would be worth expending
> the cycles on every query to determine whether the situation holds.
> AFAICS those would be wasted cycles on the huge majority of queries.

Ok, fair enough. And queries that did have this issue could be easily
rewritten...

Still, there is something that doesn't site quite right with me...my
problems is with SQL really, not Postgres. For example, the server
forbids 'abcd'::char(3) but allows 'abcd' > char(3) because the operator
is not bound to the specific type, but to the general type and ignores
type constraints. In other words, SQL implicitly allows comparison
between objects of different domains if the domains differ only by
constraint (including size).

Anyways, thanks for taking the time to answer.
Merlin

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2004-03-10 17:21:54 Re: [DEFAULT] Daily digest v1.4318 (23 messages)
Previous Message Bruce Momjian 2004-03-10 16:57:52 Re: [PATCHES] log_line_info