Re: Select for update with offset interferes with concurrent transactions

Поиск
Список
Период
Сортировка
От Radosław Smogura
Тема Re: Select for update with offset interferes with concurrent transactions
Дата
Msg-id 201102012005.22670.rsmogura@softperience.eu
обсуждение исходный текст
Ответ на Re: Select for update with offset interferes with concurrent transactions  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hmm...

May I ask how this look in details. If e.g. I do select * from myeshop offset
100 limit 20, I have 1000 rows which rows will be locked?

a) 0 to 120, or
b) all rows will be locked.?

Kind regards,
Radek

Tom Lane <tgl@sss.pgh.pa.us> Tuesday 01 February 2011 18:18:17
> In 9.0, LIMIT/OFFSET processing is done after FOR UPDATE locking, which
> means that rows skipped over by OFFSET still get locked, which means
> that different sessions executing this query are now practically certain
> to block each other, rather than just likely to block each other.
> This was an intentional change to improve the predictability of FOR
> UPDATE's interactions with LIMIT/OFFSET, and indeed it's improved the
> predictability of the behavior for you, just not in the direction you'd
> like :-(
>
>             regards, tom lane

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

Предыдущее
От: Andy Colson
Дата:
Сообщение: Re: Select for update with offset interferes with concurrent transactions
Следующее
От: "Yngve Nysaeter Pettersen"
Дата:
Сообщение: Re: Select for update with offset interferes with concurrent transactions