Re: "not related" code blocks for removal of dead rows when using vacuum and this kills the performance

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: "not related" code blocks for removal of dead rows when using vacuum and this kills the performance
Дата
Msg-id 6ba1f723a0b6af4a1deedbe543c70ba2630b4e09.camel@cybertec.at
обсуждение исходный текст
Ответ на "not related" code blocks for removal of dead rows when using vacuum and this kills the performance  (Lars Aksel Opsahl <Lars.Opsahl@nibio.no>)
Ответы Re: "not related" code blocks for removal of dead rows when using vacuum and this kills the performance  (Lars Aksel Opsahl <Lars.Opsahl@nibio.no>)
Список pgsql-performance
On Mon, 2024-02-19 at 16:14 +0000, Lars Aksel Opsahl wrote:
> Then we start testing VACUUM and very simple SQL testing in another window.
>
> We can now show we have performance of "3343.794 ms" and not "0.123 ms", which
> is what we get when we are able to remove dead rows and run a new analyze.
>
> The problem is that as long as the master code is active, we cannot remove
> alle dead rows and that what seems to be killing the performance.
>
> With active I mean in hanging on pg_sleep and remember that this master has
> not created the test table or inserted any data in this test table it self.
>
> Is the expected behavior ?

It is not entirely clear what you are doing, but it seems like you are holding
a database transaction open, and yes, then it is expected behavior that
VACUUM cannot clean up dead rows in the table.

Make sure that your database transactions are short.
Don't use table or row locks to synchronize application threads.
What you could use to synchronize your application threads are advisory locks,
they are not tied to a database transaction.

Yours,
Laurenz Albe



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

Предыдущее
От: Lars Aksel Opsahl
Дата:
Сообщение: "not related" code blocks for removal of dead rows when using vacuum and this kills the performance
Следующее
От: Lars Aksel Opsahl
Дата:
Сообщение: Re: "not related" code blocks for removal of dead rows when using vacuum and this kills the performance