Re: Blocking excessively in FOR UPDATE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 3, 2011 at 4:29 PM, Claudio Freire <klaussfreire@xxxxxxxxx> wrote:
> Next time I find it blocking, I will check pg_locks directly and post
> the output.

Here it is, two instances of the query, while blocked:

select * from pg_locks where pid = 22636;

   locktype    | database | relation | page | tuple | virtualxid  |
transactionid | classid | objid | objsubid | virtualtransaction |  pid
 |       mode       | granted
---------------+----------+----------+------+-------+-------------+---------------+---------+-------+----------+--------------------+-------+------------------+---------
 transactionid |          |          |      |       |             |
 360992199 |         |       |          | 89/22579344        | 22636 |
ExclusiveLock    | t
 virtualxid    |          |          |      |       | 89/22579344 |
           |         |       |          | 89/22579344        | 22636 |
ExclusiveLock    | t
 relation      |    16398 |  5552020 |      |       |             |
           |         |       |          | 89/22579344        | 22636 |
AccessShareLock  | t
 relation      |    16398 |  5552020 |      |       |             |
           |         |       |          | 89/22579344        | 22636 |
RowExclusiveLock | t
 relation      |    16398 |  5552019 |      |       |             |
           |         |       |          | 89/22579344        | 22636 |
AccessShareLock  | t
 relation      |    16398 |  5552019 |      |       |             |
           |         |       |          | 89/22579344        | 22636 |
RowExclusiveLock | t
 relation      |    16398 |  5525292 |      |       |             |
           |         |       |          | 89/22579344        | 22636 |
RowShareLock     | t
 relation      |    16398 |  5525292 |      |       |             |
           |         |       |          | 89/22579344        | 22636 |
RowExclusiveLock | t
 relation      |    16398 |  5552008 |      |       |             |
           |         |       |          | 89/22579344        | 22636 |
AccessShareLock  | t
 relation      |    16398 |  5552008 |      |       |             |
           |         |       |          | 89/22579344        | 22636 |
RowExclusiveLock | t
(10 rows)

select * from pg_locks where pid = 22618;

   locktype    | database | relation | page | tuple | virtualxid  |
transactionid | classid | objid | objsubid | virtualtransaction |  pid
 |       mode       | granted
---------------+----------+----------+------+-------+-------------+---------------+---------+-------+----------+--------------------+-------+------------------+---------
 virtualxid    |          |          |      |       | 159/2706505 |
           |         |       |          | 159/2706505        | 22618 |
ExclusiveLock    | t
 relation      |    16398 |  5551986 |      |       |             |
           |         |       |          | 159/2706505        | 22618 |
AccessShareLock  | t
 transactionid |          |          |      |       |             |
 360992478 |         |       |          | 159/2706505        | 22618 |
ExclusiveLock    | t
 relation      |    16398 |  5552008 |      |       |             |
           |         |       |          | 159/2706505        | 22618 |
AccessShareLock  | t
 relation      |    16398 |  5552008 |      |       |             |
           |         |       |          | 159/2706505        | 22618 |
RowExclusiveLock | t
 relation      |    16398 |  5526310 |      |       |             |
           |         |       |          | 159/2706505        | 22618 |
RowShareLock     | t
 relation      |    16398 |  5552020 |      |       |             |
           |         |       |          | 159/2706505        | 22618 |
AccessShareLock  | t
 relation      |    16398 |  5552020 |      |       |             |
           |         |       |          | 159/2706505        | 22618 |
RowExclusiveLock | t
 relation      |    16398 |  5526308 |      |       |             |
           |         |       |          | 159/2706505        | 22618 |
AccessShareLock  | t
 relation      |    16398 |  5552019 |      |       |             |
           |         |       |          | 159/2706505        | 22618 |
AccessShareLock  | t
 relation      |    16398 |  5552019 |      |       |             |
           |         |       |          | 159/2706505        | 22618 |
RowExclusiveLock | t
 relation      |    16398 |  5525296 |      |       |             |
           |         |       |          | 159/2706505        | 22618 |
RowShareLock     | t
 relation      |    16398 |  5525292 |      |       |             |
           |         |       |          | 159/2706505        | 22618 |
RowShareLock     | t
 relation      |    16398 |  5525292 |      |       |             |
           |         |       |          | 159/2706505        | 22618 |
RowExclusiveLock | t
(14 rows)

-- 
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux