Re: [COMMITTERS] pgsql-server: Rearrange pg_subtrans handling
От | Tom Lane |
---|---|
Тема | Re: [COMMITTERS] pgsql-server: Rearrange pg_subtrans handling |
Дата | |
Msg-id | 28790.1093325897@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: [COMMITTERS] pgsql-server: Rearrange pg_subtrans (Stephan Szabo <sszabo@megazone.bigpanda.com>) |
Ответы |
Re: [COMMITTERS] pgsql-server: Rearrange pg_subtrans handling
|
Список | pgsql-hackers |
Stephan Szabo <sszabo@megazone.bigpanda.com> writes: > On Tue, 24 Aug 2004, Christopher Kings-Lynne wrote: >> OK, what I mean is to know if a row is locked by any backend, why can't >> we just put a reference count of the number of locks on that row, >> instead of recording each backend separately? Wouldn't that require a >> fixed amount of shared mem? > AFAICT you have to do something on top of that to allow deadlock > detection. If transaction X has a shared row lock on A and is waiting on > a lock for me and I want to get an exclusive row lock on A, how do I > detect that it's a deadlock? I think the speed complaint I was just raising could possibly be answered by setting an infomask bit indicating that the row might be present in a separate table of active row locks. (I'm not sure how the bit would get cleared without race conditions, but let's suppose that can be done.) A little hashing, a little spill-to-disk logic, and it might be done. But that's just handwaving... anyone want to try to fill in the details? [ But to answer Chris' question: no, I don't see any way that this could be a fixed-size table. You will need that spill-to-disk bit. ] regards, tom lane
В списке pgsql-hackers по дате отправления: