Improve planner cost estimations for alternative subplans

Поиск
Список
Период
Сортировка
От Alexey Bashtanov
Тема Improve planner cost estimations for alternative subplans
Дата
Msg-id 07b3fa88-aa4e-2e13-423d-8389eb1712cf@imap.cc
обсуждение исходный текст
Ответы Re: Improve planner cost estimations for alternative subplans  (Melanie Plageman <melanieplageman@gmail.com>)
Re: Improve planner cost estimations for alternative subplans  (Melanie Plageman <melanieplageman@gmail.com>)
Список pgsql-hackers
Hello,

Currently, in case of alternative subplans that do hashed vs per-row 
lookups,
the per-row estimate is used when planning the rest of the query.
It's also coded in not quite an explicit way.

In [1] we found a situation where it leads to a suboptimal plan,
as it bloats the overall cost into large figures,
a decision related to an outer part of the plan look negligible to the 
planner,
and as a result it doesn't elaborate on choosing the optimal one.

The patch is to fix it. Our linear model for costs cannot quite accommodate
the piecewise linear matter of alternative subplans,
so it is based on ugly heuristics and still cannot be very precise,
but I think it's better than the current one.

Thoughts?

Best, Alex

[1] 
https://www.postgresql.org/message-id/flat/ff42b25b-ff03-27f8-ed11-b8255d658cd5%40imap.cc

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Make more use of RELKIND_HAS_STORAGE()
Следующее
От: Tom Lane
Дата:
Сообщение: Re: valgrind error