Search Postgresql Archives

Re: RAISE INFO in function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





po 9. 11. 2020 v 14:46 odesílatel Yambu <hyambu@xxxxxxxxx> napsal:
Hi

May i know if RAISE INFO impacts performance significantly in a function?

Should i comment them out once i'm done using/debugging ?

It depends on more factors - but expressions in RAISE statements are calculated every time and sometimes the result can be filtered. Inside cycles or when functions is evaluated for every row of query, then the overhead can be significant:

postgres=# do $$
begin
  for i in 1..100000 loop
    raise debug '%', i;
  end loop;
end;
$$;
DO
Time: 35,164 ms
postgres=# do $$
begin
 -- plpgsql cannot to ignore empty blocks, this loop was evaluated 100K
  for i in 1..100000 loop
    --raise debug '%', i + 1;
  end loop;
end;
$$;
DO
Time: 2,535 ms

Regards

Pavel


regards

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux