Hacker News new | ask | show | jobs
by JoelJacobson 4990 days ago
If you need even more fine-grained statistics, check out https://github.com/johto/call_graph

It allows you to get statistics per top-level function, which can reveal abnormalities otherwise impossible to detect, such as a function which is usually very fast, but very slow for a small number of calls relative to the total number of calls. Consider fa()->fx() and fb()->fx(), if fa()->fx() always is fast and you have a million such calls, but for some reason fb()->fx() is very slow, but you only have a few such calls, fx() will look like a very fast function without any performance problems, if you only look at pg_catalog.pg_stat_user_functions, but call_graph will reveal fx() being slow when called by the top-level function fb().

This is only relevant for systems always accessing the database through Stored Procedures though.