Re: [PATCH] Tracking statements entry timestamp in pg_stat_statements

Поиск
Список
Период
Сортировка
От Alena Rybakina
Тема Re: [PATCH] Tracking statements entry timestamp in pg_stat_statements
Дата
Msg-id 00c073b3-721d-4656-9528-b64a155aa2b9@yandex.ru
обсуждение исходный текст
Ответ на Re: [PATCH] Tracking statements entry timestamp in pg_stat_statements  (Andrei Zubkov <zubkov@moonset.ru>)
Ответы Re: [PATCH] Tracking statements entry timestamp in pg_stat_statements  (Andrei Zubkov <zubkov@moonset.ru>)
Список pgsql-hackers
On 19.10.2023 15:40, Andrei Zubkov wrote:
Hi hackers,

New version 23 attached. It contains rebase to the current master.
Noted that v1.11 adds new fields to the pg_stat_sstatements view, but
leaves the PGSS_FILE_HEADER constant unchanged. It this correct?
Hi! Thank you for your work on the subject.

1. I didn't understand why we first try to find pgssEntry with a false top_level value, and later find it with a true top_level value./*
 * Remove the entry if it exists, starting with the non-top-level entry.
 */
key.toplevel = false;
entry = (pgssEntry *) hash_search(pgss_hash, &key, HASH_FIND, NULL);

SINGLE_ENTRY_RESET(entry);

/* Also reset the top-level entry if it exists. */
key.toplevel = true;

entry = (pgssEntry *) hash_search(pgss_hash, &key, HASH_FIND, NULL);

SINGLE_ENTRY_RESET(entry);

I looked through this topic and found some explanation in this email [0], but I didn't understand it. Can you explain it to me?

2. And honestly, I think you should change
"Remove the entry if it exists, starting with the non-top-level entry." on
"Remove the entry or reset min/max time statistic information and the timestamp if it exists, starting with the non-top-level entry."

And the same with the comment bellow:

"Also reset the top-level entry if it exists."
"Also remove the entry or reset min/max time statistic information and the timestamp if it exists." In my opinion, this is necessary because the minmax_only parameter is set by the user, so both ways are possible.


0 - https://www.postgresql.org/message-id/62d16845-e74e-a6f9-9661-022e44f48922%40inbox.ru

-- 
Regards,
Alena Rybakina

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

Предыдущее
От: Aleksander Alekseev
Дата:
Сообщение: Re: Add connection active, idle time to pg_stat_activity
Следующее
От: Andrei Zubkov
Дата:
Сообщение: Re: Add connection active, idle time to pg_stat_activity