Does RAISE NOTICE 'text' in triggers slow down queries in Postgresql?
Asked Answered
F

1

6

When I'm testing my query triggers, I see that the query execution time increase when I'm putting a lot of "RAISE NOTICE ... " in the trigger code. Does this time increase also when I'm calling this queries in my softwares without displaying output in the messages windows or it's only when the messages output is attached?

Fatimafatimah answered 28/4, 2016 at 9:4 Comment(0)
P
4

Based on my own experience with plpgSQL, I would say yes. And according to the authors of the book PostgreSQL Server Programming - Second Edition (by Usama Dar, Hannu Krosing, Jim Mlodgenski, Kirk Roybal):

[...] The RAISE statements need to be written, commented out, and restored when needed.[...] They also slow down the execution of the routine.[...]

p.134

enter image description here

Plauen answered 28/12, 2019 at 17:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.