Re: Lock acquisition for partition table when setting generic plan

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Lock acquisition for partition table when setting generic plan
Дата
Msg-id 2183.1579100950@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Lock acquisition for partition table when setting generic plan  ("yotsunaga.naoki@fujitsu.com" <yotsunaga.naoki@fujitsu.com>)
Список pgsql-general
"yotsunaga.naoki@fujitsu.com" <yotsunaga.naoki@fujitsu.com> writes:
> I did the following.
> Even though I accessed one partition table(test2 table), I also acquired locks on other partition tables(test1
table).
> I expected to acquire locks on the parent table(test table) and the partition table to access(test2 table).
> Why does this happen?

You specified a generic plan:

> postgres=# set plan_cache_mode = force_generic_plan ;

so you are not going to get any plan-time optimization based on knowing
the id parameter.  Therefore the plan must include sub-plan nodes for
every child table, so executing it requires locking all those tables
to make sure their schemas haven't changed.

            regards, tom lane



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

Предыдущее
От: Laurenz Albe
Дата:
Сообщение: Re: Lock leaking out of Transaction?
Следующее
От: Kasun Kulathunga
Дата:
Сообщение: Upgrading from 9.6 to 12