Procedure calls are not tracked in pg_stat_user_functions / track_functions

Поиск
Список
Период
Сортировка
От Lukas Fittl
Тема Procedure calls are not tracked in pg_stat_user_functions / track_functions
Дата
Msg-id CAP53Pkx1JxGeXHAd3bV=EU7D2s7kAto3v4gqrDrR4as60k77Tw@mail.gmail.com
обсуждение исходный текст
Ответы Re: Procedure calls are not tracked in pg_stat_user_functions /track_functions
Список pgsql-hackers
Hi all,

It seems that currently procedures do not get tracked when track_functions is enabled, which means one needs to resort to other workarounds in order to monitor procedure calls/runtime.

To illustrate:

=# SHOW track_functions;
┌─────────────────┐
│ track_functions │
├─────────────────┤
│ all             │
└─────────────────┘
(1 row)

=# CALL abc();
CALL

=# SELECT def();
┌─────┐
│ def │
├─────┤
│     │
└─────┘
(1 row)

=# SELECT * FROM pg_stat_user_functions;
┌─[ RECORD 1 ]────────────────────┐
│ funcid     │ 75223              │
│ schemaname │ public             │
│ funcname   │ def                │
│ calls      │ 1                  │
│ total_time │ 3.222              │
│ self_time  │ 3.222              │
└────────────┴────────────────────┘

Was this intentional, or an oversight?

If welcome, I would be happy to work on a patch. Whilst slightly confusing in terms of naming, we could just track this together with functions, since one can always join with pg_proc to determine whether something is a function or a procedure.

Thanks,
Lukas

--
Lukas Fittl

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: executor relation handling
Следующее
От: Tom Lane
Дата:
Сообщение: Re: executor relation handling