YS
create table test_plan_with_multifunction(id int );Я делаю самый информативный эксплэйн:
create function f_test_plan_with_multifunction_1() returns int as $$
insert into mchist.test_plan_with_multifunction(id) values (1) returning id;
$$ language sql;
CREATE OR REPLACE FUNCTION f_test_plan_with_multifunction_2(integer)
RETURNS integer
LANGUAGE plpgsql
AS $function$
begin
if $1 < 10 then
insert into test_plan_with_multifunction(id) select mchist.f_test_plan_with_multifunction_2($1 + 1);
end if;
return $1 * f_test_plan_with_multifunction_1();
end $function$
explain (analyze, costs, buffers, verbose) select f_test_plan_with_multifunction_2(1)Но он мне выдаёт только работу самой первой вызванной функции:
Result (cost=0.00..0.26 rows=1 width=4) (actual time=0.232..0.233 rows=1 loops=1)Что хотелось бы на этом сферическом примере: увидеть вызов всех вложенных f_test_plan_with_multifunction_2, как добавляется запись в таблицу test_plan_with_multifunction_2 в результате их работы.
Output: f_test_plan_with_multifunction_2(1)
Buffers: shared hit=9
Planning Time: 0.032 ms
Execution Time: 0.257 ms
Также подлючил модуль auto_explain, проверил что появились его настройки, и выставил их:
SET auto_explain.log_nested_statements = ON;
SET auto_explain.log_min_duration = 0;
SET auto_explain.log_analyze = true;
