Re: [HACKERS] FOR SHARE LOCK clause ?

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] FOR SHARE LOCK clause ?
Дата
Msg-id 199901060445.XAA24402@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] FOR SHARE LOCK clause ?  (Vadim Mikheev <vadim@krs.ru>)
Список pgsql-hackers
> > So you are going to shared lock every row.  And if a user does a
> > sequential scan of the entire table using SELECT FOR SHARE LOCK, he
> > shared locks every row.  Isn't he going to run out of locks?
> 
> I would like to work with this issue after 6.5 and writes
> some notes about FOR SHARE LOCK limitations/problems.

OK, just checking.  You can't use the xid, so I see the problem with
shared-locking.  No way to know which rows were seen by SELECT, so no
way to shared-lock them without an explicit lock.

With Informix, UPDATE automatically locks every row, and you quickly run
out of locks.  You have to explicitly lock the table in EXCLUSIVE MODE
in a transaction to prevent your UPDATE from running out of locks on a
large transaction.  And you can still run out of log space or generate a
'large transaction' errror because the log got full before the
transaction finished.  With MVCC, these are not problems, and FOR SHARED
LOCK is just a special thing people can enable for special cases.

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


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

Предыдущее
От: Vadim Mikheev
Дата:
Сообщение: Re: [HACKERS] FOR SHARE LOCK clause ?
Следующее
От: Clark Evans
Дата:
Сообщение: Re: [HACKERS] FOR SHARE LOCK clause ?