Answer the question
In order to leave comments, you need to log in
How to get rid of record level locks and improve the performance of large tables in PostgreSQL?
There are two situations:
Answer the question
In order to leave comments, you need to log in
As it turned out, the first problem is related to the peculiarities of pgbouncer. The bottom line is that pgbouncer does not block a connection in which there is an active transaction for other clients, and in one place we have a rather long (up to 15 minutes can hang) transaction on a completely left group of tables. In general, it turned out that a bunch of updates went through one row from one table, and some of them got into a transaction that was intended for other tables, and then, after the commit, the server figured out for a long time in what order to do it all. Solution: wrap important data change requests (in our case, updating the counter) in a separate transaction, even if they go one by one.
And the second problem was solved by changing the structure of the table.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question