Re: [HACKERS] Interesting behaviour !

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] Interesting behaviour !
Дата
Msg-id 25922.931969072@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] Interesting behaviour !  (Constantin Teodorescu <teo@flex.ro>)
Ответы Re: [HACKERS] Interesting behaviour !  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [HACKERS] Interesting behaviour !  (Bruce Momjian <maillist@candle.pha.pa.us>)
Список pgsql-hackers
Constantin Teodorescu <teo@flex.ro> writes:
> Bruce Momjian wrote:
>> I thought we had this fixed in 6.5.  Is that what you are using?

> Yes!

It's not fixed, obviously.  We talked about the issue a while back,
but it isn't 100% clear what the most reasonable fix is.  Just making
the parser label small constants as int2 rather than int4 is no
answer; that'll only move the problem over to int4 tables :-(.

I have not looked closely at the parse trees produced for this sort
of thing, but if we are lucky they come out likevar int2eq (int4toint2(int4constant))
in which case the constant-subexpression-folding pass that I want to
add would solve the problem by reducing the righthand side to a simple
constant.

But it's more likely that the parser is producingint2toint4(var) int4eq int4constant
in which case it would take some actual intelligence to decide that this
could and should be converted to the other form.  I'd still be inclined
to tackle the issue in a post-rewriter, pre-planner pass over the tree.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Thomas Lockhart
Дата:
Сообщение: Re: [HACKERS] Counting bool flags in a complex query
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] MAX Query length