Re: Lock issues with partitioned table

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Lock issues with partitioned table
Дата
Msg-id 24014.1275573623@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Lock issues with partitioned table  ("Jehan-Guillaume (ioguix) de Rorthais" <ioguix@free.fr>)
Ответы Re: Lock issues with partitioned table  ("Jehan-Guillaume (ioguix) de Rorthais" <ioguix@free.fr>)
Список pgsql-general
"Jehan-Guillaume (ioguix) de Rorthais" <ioguix@free.fr> writes:
> Shouldn't locks only be on tables/indexes that are actually used by the
> planner ?

Well, yeah, they are.  The planner must take at least AccessShareLock
on any relation referenced by the query.  It might later be able to
prove that the relation needn't be scanned to deliver the query answer,
but it first has to lock the relation enough to examine its constraints
before it can prove that.  Similarly, indexes get locked for the purpose
of inspecting them, whether or not they actually get selected for use in
the plan.

AccessShareLock is a weak enough lock that this generally isn't a
problem; all that it's doing is ensuring that the table's schema
doesn't change while we're trying to devise a plan.

            regards, tom lane

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

Предыдущее
От: Justin Graf
Дата:
Сообщение: Re: How to debug efficiently
Следующее
От: Tom Lane
Дата:
Сообщение: Re: so, does this overlap or not...? - fencepost question on overlaps()