Re: Bypassing cursors in postgres_fdw to enable parallel plans

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Bypassing cursors in postgres_fdw to enable parallel plans
Дата
Msg-id CA+TgmoaLV6CmkdKFf1JUGm-MVFrmi23w_jQ3fLqLeywgwTCE=A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Bypassing cursors in postgres_fdw to enable parallel plans  (Andy Fan <zhihuifan1213@163.com>)
Список pgsql-hackers
On Wed, Mar 12, 2025 at 7:57 AM Andy Fan <zhihuifan1213@163.com> wrote:
> Do you know why we can't use parallel plan when cursor is used? Is It
> related to this code in ExecutePlan?

Yes. When a cursor is used, the whole query isn't executed all at
once, but rather the executor will be started and stopped for each
fetch from the cursor. We can't keep the parallel workers running for
that whole time, not just because it would be inefficient, but because
it would be incorrect. State changes would be possible in the leader
that were not reflected in the workers, leading to chaos.

--
Robert Haas
EDB: http://www.enterprisedb.com



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