Re: shared memory/max_locks_per_transaction error

Поиск
Список
Период
Сортировка
От Kynn Jones
Тема Re: shared memory/max_locks_per_transaction error
Дата
Msg-id c2350ba40803170730x3b4f53e4u8499555b99791977@mail.gmail.com
обсуждение исходный текст
Ответ на Re: shared memory/max_locks_per_transaction error  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: shared memory/max_locks_per_transaction error  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: shared memory/max_locks_per_transaction error  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-general
On Fri, Mar 14, 2008 at 7:12 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
"Kynn Jones" <kynnjo@gmail.com> writes:
> Initially I didn't know what our max_locks_per_transaction was (nor even a
> typical value for it), but in light of the procedure's failure after 3500
> iterations, I figured that it was 3500 or so.  In fact ours is only 64 (the
> default), so I'm now thoroughly confused.

The number of lock slots available system-wide is
max_locks_per_transaction times max_connections, and your procedure was
chewing them all.  I suggest taking the hint's advice if you really need
to create 3500 tables in a single transaction.  Actually, you'd better
do it if you want to have 3500 tables at all, because pg_dump will
certainly try to acquire AccessShare lock on all of them.

OK, in light of this, I'll have to either change my strategy (and schema) significantly or greatly increase max_locks_per_transaction.

I'm leaning towards the re-design option, primarily because I really don't really understand the consequences of cranking up max_locks_per_transaction.  E.g. Why is its default value 2^6, instead of, say, 2^15?  In fact, why is there a ceiling on the number of locks at all?  I'm guessing that the fact that the default value is relatively small (i.e. a couple of orders of magnitude below the number of tables I have in mind) suggests that setting this value to a huge number would be a terrible idea.  Is that so?

Thanks!

Kynn




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

Предыдущее
От: "Kynn Jones"
Дата:
Сообщение: Re: How to silence psql notices, warnings, etc.?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: shared memory/max_locks_per_transaction error