Re: How to speed up Exclusive Locking

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How to speed up Exclusive Locking
Дата
Msg-id 5458.1165335396@sss.pgh.pa.us
обсуждение исходный текст
Ответ на How to speed up Exclusive Locking  (David Goodenough <david.goodenough@btconnect.com>)
Список pgsql-general
David Goodenough <david.goodenough@btconnect.com> writes:
> The statements issued to lock each table is:-
>  LOCK TABLE table IN EXCLUSIVE MODE; SELECT 1 FROM table;
> (I am not quite sure why the SELECT 1 FROM table is there, it came with
> HA-JDBC as the code for the Postgresql dialect).

> I notice that this seems to take a time that is dependant on the size
> of the table, which seems odd - almost as though it is locking each row
> rather than the whole table at once.

No, but it's *reading* each row to execute the "SELECT 1 FROM table".

            regards, tom lane

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