Re: Why is AccessShareLock held until end of transaction?

Поиск
Список
Период
Сортировка
От Atri Sharma
Тема Re: Why is AccessShareLock held until end of transaction?
Дата
Msg-id CAOeZViebr6736S-3KfJWJQYA136Bsc2Jjdys51eaE+wqj2phEw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Why is AccessShareLock held until end of transaction?  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-hackers



On Tue, Mar 11, 2014 at 11:07 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
On 11 March 2014 17:29, Atri Sharma <atri.jiit@gmail.com> wrote:
>
>
>
> On Tue, Mar 11, 2014 at 10:56 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
>>
>> On 11 March 2014 03:41, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> > Joe Conway <mail@joeconway.com> writes:
>> >> I am probably missing something obvious, but why does the
>> >> AccessShareLock remain held on a table after a SELECT statement is
>> >> complete when in a transaction block?
>> >
>> > *Any* lock acquired by user command is held till end of transaction;
>> > AccessShareLock isn't special.
>> >
>> > In general, releasing early would increase the risk of undesirable
>> > behaviors such as tables changing definition mid-transaction.
>>
>> I thought "good question" at first, but the workaround is simple...
>> just don't use multi-step transactions, submit each request as a
>> separate transaction.
>>
>>
> Wouldnt that tend to get inefficient?

Please outline your alternate proposal so we can judge the comparative
efficiency.



I dont have an alternate proposal yet. I was just wondering if per step transactions could lead to a drop in performance.

If that is the best way to go, I am all for it.

Regards,

Atri



--
Regards,
 
Atri
l'apprenant

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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Why is AccessShareLock held until end of transaction?
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: [PATCH] Store Extension Options