Re: huge disparities in =/IN/BETWEEN performance

Поиск
Список
Период
Сортировка
От Joe
Тема Re: huge disparities in =/IN/BETWEEN performance
Дата
Msg-id 1170994335.697.55.camel@pampa
обсуждение исходный текст
Ответ на Re: huge disparities in =/IN/BETWEEN performance  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: huge disparities in =/IN/BETWEEN performance  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
Hi Tom,

On Thu, 2007-02-08 at 22:50 -0500, Tom Lane wrote:
> There's a datatype abstraction issue involved: what does it take to
> prove that "x >= 10 AND x <= 10" is equivalent to "x = 10"?  This
> requires a nontrivial amount of knowledge about the operators involved.
> We could probably do it for operators appearing in a btree operator
> class, but as Alvaro says, it'd be cycles wasted for non-dumb queries.

Are you saying the planner is datatype-agnostic and can't tell that x
is, say, as in the example above, an INTEGER and therefore cannot
transform one expression into another?  What about "x = 10 AND x < 5"?
Can't it reduce that to FALSE?

Joe



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: huge disparities in =/IN/BETWEEN performance
Следующее
От: Tom Lane
Дата:
Сообщение: Re: huge disparities in =/IN/BETWEEN performance