I see quite a few cases where the following occurs in my Postgres log:
LOG: process x still waiting for ShareLock on transaction y after 1000.109 ms DETAIL: Process holding the lock: z. Wait queue: x. CONTEXT: while inserting index tuple (a,b) in relation "my_test_table" SQL function "my_test_function" statement 1 ... LOG: process x acquired ShareLock on transaction y after 1013.664 ms CONTEXT: while inserting index tuple (a,b) in relation "my_test_table"
I am using Postgres 9.5.3 . In addition, I work for Heroku, so I donβt have access to the fine-grained debugging tools only for the superuser.
I am wondering what is the best way to debug such a problem taking into account these limitations and the fact that each individual lock is relatively temporary (usually 1000-2000 ms).
Things I tried:
pg_locks
pg_class
pageinspect
pgbench
, ( > 1), , , , . , , , .
, ShareLock .
, , /, . "". , , PostgreSQL ExclusiveLock . , , ShareLock , , ExclusiveLock /. .
, () INSERT a UNIQUE PRIMARY KEY , ββ/ . , - , , , / ββ/.
INSERT
UNIQUE
PRIMARY KEY
, . proc "x" "my_test_table" , proc "y" xact "z", , .
, - upsert . , - /, , , .
, .
Source: https://habr.com/ru/post/1685966/More articles:Create a mask only in the first positions - arraysGitLab Docker Crash Error - Access Denied - gitlabErrors when publishing to an Angular 4 project in Visual Studio Team Services - angularEWS - Calendar list crashes while trying to load attendees - c #Where, @ abbreviation for quasi-quasota-splicing? - schemeHow to call a service from a module at a new created level in Java 9? - javaHow to manage inventory of entry tickets in the BlueSnap API - payment-gatewayHow to dynamically set environment variable in spring test - javaParsing with Java 8 DateTimeFormatter and Spanish Month Names - javaFix indented PHP files with php-cs-fixer - code-formattingAll Articles