Re: Unnecessary locks for partitioned tables

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Unnecessary locks for partitioned tables
Дата
Msg-id 3968476.1668004175@sss.pgh.pa.us
обсуждение исходный текст
Ответ на RE: Unnecessary locks for partitioned tables  (<n.kobzarev@aeronavigator.ru>)
Ответы RE: Unnecessary locks for partitioned tables  (<n.kobzarev@aeronavigator.ru>)
Список pgsql-general
<n.kobzarev@aeronavigator.ru> writes:
> Oh, I did not explicitly write that, in case of custom plan (first attempts or with force_custom_plan) database holds
onlya couple of locks! Why in this case it is sufficient to lock only one partition and parent table ? 

Because partition routing is done at planning time in that case, based
on the actual values of the plan's parameters.  A generic plan
doesn't have the parameter values available, so it has to build
plan nodes for every partition that could conceivably be accessed.
So for queries of this kind (ie point queries against heavily partitioned
tables) the generic plan is pretty much always going to lose.  That
doesn't bother me enormously --- there are other query patterns
with similar behavior.

If you know that your queries always need custom plans, I question
the value of using PREPARE at all.

            regards, tom lane



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

Предыдущее
От:
Дата:
Сообщение: RE: Unnecessary locks for partitioned tables
Следующее
От:
Дата:
Сообщение: RE: Unnecessary locks for partitioned tables