Re: Hung Query with No Locking Issues

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Hung Query with No Locking Issues
Дата
Msg-id 209710.1683507617@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Hung Query with No Locking Issues  ("Michael P. McDonnell" <bzaks1424@gmail.com>)
Список pgsql-general
"Michael P. McDonnell" <bzaks1424@gmail.com> writes:
> On Sun, May 7, 2023 at 4:25 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Perhaps an "ANALYZE table_b" in between would help.

> Okay - that worked.
> How did you know that would work? That's incredible.

Well, I guessed ;-) ... but it was a well-educated guess.

The symptoms sounded like you were getting a bad plan choice for
the second query, which is unsurprising if you populate a table
from empty and don't give auto-analyze enough time to collect
some statistics behind your back.

As a solution going forward, I'd recommend adding the ANALYZE
as the last step in the table-populating procedure.

            regards, tom lane



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

Предыдущее
От: "Michael P. McDonnell"
Дата:
Сообщение: Re: Hung Query with No Locking Issues
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: "PANIC: could not open critical system index 2662" - twice