Re: fix cost subqueryscan wrong parallel cost

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: fix cost subqueryscan wrong parallel cost
Дата
Msg-id 2455611.1651690118@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: fix cost subqueryscan wrong parallel cost  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Tue, May 3, 2022 at 2:13 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> In any case, fundamental redesign of what EXPLAIN prints is a job
>> for v16 or later.  Are you okay with the proposed patch as a v15 fix?

> Yes. I can't really vouch for it, but I don't object to it.

I re-read the patch and noticed that I'd missed one additional change
needed:

-    run_cost = cpu_per_tuple * baserel->tuples;
+    run_cost = cpu_per_tuple * path->subpath->rows;

That is, we should estimate the number of qual evaluations and
cpu_tuple_cost charges based on the subpath row count not the
non-parallel-aware relation size.  So this reduces the cost of
the SubqueryScan itself, as well as its row count, in partial paths.
I don't see any further change in regression test results though.

Pushed with that change.

            regards, tom lane



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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: strange slow query - lost lot of time somewhere
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: Query generates infinite loop