Re: SHARED LOCKS , EXCLUSIVE LOCKS, ACCESS EXCLUSIVE LOCKS

Поиск
Список
Период
Сортировка
От Amine Tengilimoglu
Тема Re: SHARED LOCKS , EXCLUSIVE LOCKS, ACCESS EXCLUSIVE LOCKS
Дата
Msg-id CADTdw-xLHkqwe9BqxN7wQozEuWPyav+wJjKt-W0bRtSH5uneXQ@mail.gmail.com
обсуждение исходный текст
Ответ на SHARED LOCKS , EXCLUSIVE LOCKS, ACCESS EXCLUSIVE LOCKS  (aditya desai <admad123@gmail.com>)
Список pgsql-performance
Hi;

It's normal to see locks on tables during queries. These are usually locks used automatically by postgres as a result of the operations you perform on your database. You should check the document for the lock modes postgres uses.

Lock causes slowness if it causes other queries to wait. You can see the queries waiting for lock from pg_locks view.  Access Exclusive Lock completely locks the table, does not allow read and write operations, blocks queries. 

Commands such as  drop table, truncate, reindex, vacuum full, alter table use this lock. And autovacuum  uses a weaker lock on the table, not using an exclusive lock.

aditya desai <admad123@gmail.com>, 4 Nis 2021 Paz, 13:42 tarihinde şunu yazdı:
Hi,
We have few select queries during which we see SHARED LOCKS and EXCLUSIVE LOCKS on tables. Can these locks cause slowness? Is there any way to reduce the locks?

What must be causing ACCESS EXCLUSIVE LOCKS when the application is running select queries? Is it AUTOVACUUM?

Regards,
Aditya.

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

Предыдущее
От: aditya desai
Дата:
Сообщение: Re: SELECT Query taking 200 ms on PostgreSQL compared to 4 ms on Oracle after migration.
Следующее
От: Justin Pryzby
Дата:
Сообщение: Re: SHARED LOCKS , EXCLUSIVE LOCKS, ACCESS EXCLUSIVE LOCKS