Re: Incorrect cost for MergeAppend

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Incorrect cost for MergeAppend
Дата
Msg-id 202401311352.z3rcalslkxo5@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: Incorrect cost for MergeAppend  (Alexander Kuzmenkov <akuzmenkov@timescale.com>)
Ответы Re: Incorrect cost for MergeAppend  ("Daniel Westermann (DWE)" <daniel.westermann@dbi-services.com>)
Re: Incorrect cost for MergeAppend  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 2024-Jan-31, Alexander Kuzmenkov wrote:

> To put it another way, this change enables our usual cost model for
> MergeAppend to work correctly in the presence of filters. I think we
> can consider this model to be reasonably correct, and we don't
> currently have major problems with MergeAppend being chosen instead of
> Sort + Append in cases where it's suboptimal, right? So applying it
> properly in case with filters is not likely to introduce problems.

Since we have a minor coming up very soon, I think it's not a good idea
to backpatch right now.  Maybe you can push to master now, and consider
whether to backpatch later.

The problem is -- if somebody has an application that gets good plans
with the current cost model, and you change the cost model and the plans
become worse, what do they do?  If you change this in a major release,
this is not an issue because they must test their queries before
upgrading and if they fail to realize a problem exists then it's their
fault.  If you change it in a minor release, then those people will be
very upset that things were changed suddenly, and they may get wary of
future minor upgrades, which we don't want.

Plus, they would need to do careful testing before doing the minor
upgrade.

Maybe plans can only go from bad to good and never from good to bad.
But are we 100% certain that that is the case?

People who are **desperate** to get this improvement can perhaps run a
patched version in the meantime.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/



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

Предыдущее
От: Alexander Kuzmenkov
Дата:
Сообщение: Re: Incorrect cost for MergeAppend
Следующее
От: James Coleman
Дата:
Сообщение: Re: Parallelize correlated subqueries that execute within each worker