Re: [GENERAL] Deadlock with single update statement?

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: [GENERAL] Deadlock with single update statement?
Дата
Msg-id 20170610234115.letm3s5pj5a5snvl@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: [GENERAL] Deadlock with single update statement?  (Justin Pryzby <pryzby@telsasoft.com>)
Список pgsql-general
Justin Pryzby wrote:

> detail|Process 26871 waits for ShareLock on transaction 13693505; blocked by process 26646.
> Process 26646 waits for ShareLock on transaction 13693504; blocked by process 26871.
> Process 26871: SELECT db_column_name,table_name FROM huawei_m2000_counter_details ORDER BY ctid FOR UPDATE
> Process 26646: SELECT db_column_name,table_name FROM huawei_m2000_counter_details ORDER BY ctid FOR UPDATE

Uh, this is locking the whole table.  Is there no useful WHERE?  What
you should be doing is SELECT WHERE <key values> ORDER BY <key> FOR
UPDATE where <key> is indexed.

--
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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

Предыдущее
От: rob stone
Дата:
Сообщение: Re: [GENERAL] Inconsistent performance with LIKE and bind variableon long-lived connection
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: [GENERAL] ERROR: unexpected chunk number 0 (expected 1) fortoast value 76753264 in pg_toast_10920100