Re: Doc update for pg_stat_statements normalization

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Doc update for pg_stat_statements normalization
Дата
Msg-id Y/v7Hg0kSMZqYPEG@paquier.xyz
обсуждение исходный текст
Ответ на Re: Doc update for pg_stat_statements normalization  ("Imseih (AWS), Sami" <simseih@amazon.com>)
Ответы Re: Doc update for pg_stat_statements normalization
Список pgsql-hackers
On Sat, Feb 25, 2023 at 01:59:04PM +0000, Imseih (AWS), Sami wrote:
> The overhead of storing this additional private data for the life of the query
> execution may not be  desirable.

Okay, but why?

> I think we also will need to copy the
> private data to QueryDesc as well to make it available to planner/utility/exec
> hooks.

This seems like the key point to me here.  If we copy more information
into the Query structures, then we basically have no need for sticky
entries, which could be an advantage on its own as it simplifies the
deallocation and lookup logic.

For a DML or a SELECT, the manipulation of the hash table would still
be a three-step process (post-analyze, planner and execution end), but
the first step would have no need to use an exclusive lock on the hash
table because we could just read and copy over the Query the
normalized query if an entry exists, meaning that we could actually
relax things a bit?  This relaxation has as cost the extra memory used
to store more data to allow the insertion to use a proper state of the
Query[Desc] coming from the JumbleState (this extra data has no need
to be JumbleState, just the results we generate from it aka the
normalized query).

> In v14, we added a dealloc metric to pg_stat_statements_info, which is helpful.
> However, this only deals with the pgss_hash entry deallocation.
> I think we should also add a metric for the text file garbage collection.

This sounds like a good idea on its own.
--
Michael

Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Provide PID data for "cannot wait on a latch owned by another process" in latch.c
Следующее
От: "gamefunc"
Дата:
Сообщение: [PATCH] fix msvc build libpq error LNK2019 when link openssl;