RE: About row locking ordering

Поиск
Список
Период
Сортировка
От Ryo Yamaji (Fujitsu)
Тема RE: About row locking ordering
Дата
Msg-id TYAPR01MB607338C0C3A81AC8788094388A1A9@TYAPR01MB6073.jpnprd01.prod.outlook.com
обсуждение исходный текст
Ответ на Re: About row locking ordering  (Kirk Wolak <wolakk@gmail.com>)
Список pgsql-general
Thank you for your comments. Sorry for the late reply.

From: Kirk Wolak  Sent: Friday, November 25, 2022 6:12 PM
> My first question is why are you not using "WHERE CURRENT OF" cursor_name?

I thought that cursors are preferred for manipulating large numbers of rows. 
So I did not consider using cursors in this test case because each process manipulates only one row.

However, assuming general usage, I thought it would be preferable to use a cursor, as you pointed out, because it might
resultin fewer table accesses.
 
I didn't have that knowledge.


> But effectively, you are locking the row and that is the row you want to update (the current row of the cursor).
> I wonder if that addresses the problem...

I tested it with a cursor, but there was still a problem..
I will attach the script used for the test, though it will be simple.

Вложения

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: snapshot question
Следующее
От: "Nunya Business"
Дата:
Сообщение: Re[4]: PG 14.5 -- Impossible to restore dump due to interaction/order of views, functions, and generated columns