Re: optimizing impossible matches
От | Merlin Moncure |
---|---|
Тема | Re: optimizing impossible matches |
Дата | |
Msg-id | 6EE64EF3AB31D5448D0007DD34EEB34101AD87@Herge.rcsinc.local обсуждение исходный текст |
Ответ на | optimizing impossible matches ("Merlin Moncure" <merlin.moncure@rcsonline.com>) |
Список | 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
В списке pgsql-hackers по дате отправления: