Re: huge disparities in =/IN/BETWEEN performance

Поиск
Список
Период
Сортировка
От Joe
Тема Re: huge disparities in =/IN/BETWEEN performance
Дата
Msg-id 1170997319.697.72.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 23:24 -0500, Tom Lane wrote:
> Certainly, but your other concerns don't follow from that.  The issue at
> hand here is whether it's worth expending cycles on every query to try
> to detect a situation that only holds for a few.

Those where George's concerns, but I was interested in knowing whether
the planner transforms a query in any way to avoid, let's say, useless
execution.  George didn't provide the inside of his view, but it's
possible that my earlier example could be rephrased as follows:

create view v_foo as select * from tab where x < 5;
select * from v_foo where x = 10;

Presumably the planner has to transform the SELECT into

select * from tab where x < 5 and x = 10;

or something analogous.  This is a simple example, but with complicated
views or even joins and aggregates, the "useless execution" may not be
that obvious to the "naked eye" but it would be to a boolean logic
analyzer.

As to whether these query instances represent few or are typical is
arguable, and will depend on the type of application, level of knowledge
among users, and what kind of interfaces are used to enter or generate
the queries.

Joe



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

Предыдущее
От: Arulmani V A
Дата:
Сообщение: unsubscribe
Следующее
От: Patrice Oliver
Дата:
Сообщение: unsubscribe