Re: Regression in IN( field, field, field ) performance

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Regression in IN( field, field, field ) performance
Дата
Msg-id 603c8f070810251131m4e9cf4efl8c6e877d1fbd2022@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Regression in IN( field, field, field ) performance  (Decibel! <decibel@decibel.org>)
Ответы Re: Regression in IN( field, field, field ) performance  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> There's 6 cases here, in a 2x3 array. In one dimension, the LHS can be
> either a Var or a fixed value. In the other dimension, the three
> possibilities are 1: everything on the RHS is a fixed value, 2: some fixed,
> some not, 3: everything on the RHS is a variable:
[...lengthy discussion of cases...]

It seems like you're saying that the only time the array wins here is
when you're comparing an expression against a whole bunch of
constants.  Given that, would it make any sense to put all the
constants in an ARRAY and use OR for any variables?  i.e. given

Whatever IN (Const1, Var1, Const2, Var2, Const3, Var3)

Generate:

Whatever = ANY (ARRAY[Const1, Const2, Const3]) OR Whatever = Var1 OR
Whatever = Var2 OR Whatever = Var3

...Robert


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Full socket send buffer prevents cancel, timeout
Следующее
От: "Robert Haas"
Дата:
Сообщение: Re: Handling NULL records in plpgsql