Re: [HACKERS] More optimization effort?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] More optimization effort?
Дата
Msg-id 30386.1500647583@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [HACKERS] More optimization effort?  (Tatsuo Ishii <ishii@sraoss.co.jp>)
Ответы Re: [HACKERS] More optimization effort?  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Tatsuo Ishii <ishii@sraoss.co.jp> writes:
> Currently following query does not use an index:
> test=# explain select * from pgbench_accounts where aid*100 < 10000;
> While following one does use the index.
> test=# explain select * from pgbench_accounts where aid < 10000/100;

> Is it worth to make our optimizer a little bit smarter to convert the
> the first query into the second form?

That's a rather ambitious definition of "little bit" smarter.

For starters, I'm not sure those queries are even fully equivalent
w.r.t. issues like overflow and roundoff.  While a person might
decide that the transformation is OK anyway, I'm not sure that the
optimizer should be allowed to take such liberties.

But the bigger picture is that doing something that helps to any
useful extent would require a really substantial amount of new,
datatype- and operator-specific knowledge that doesn't exist in the
system today.  And as Craig noted, applying that knowledge would
be expensive, even in cases where it failed to help.

So, color me skeptical ...
        regards, tom lane



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

Предыдущее
От: Hadi Moshayedi
Дата:
Сообщение: Re: [HACKERS] [PATCH] Make ExplainBeginGroup()/ExplainEndGroup() public.
Следующее
От: Marina Polyakova
Дата:
Сообщение: Re: [HACKERS] WIP Patch: Precalculate stable functions,infrastructure v1