这花了我一段时间才弄清楚,几周前我在一个外语维基上找到了答案,它非常有帮助,所以我想我会分享。
在 Win32 上的 PostgreSQL 8.3 上,默认情况下会安装分析插件,但不会加载。只需执行以下 SQL:
LOAD '$libdir/plugins/plugin_profiler.dll';
SET plpgsql.profiler_tablename = 'bazzybar';
...然后当你想分析一些代码时,
drop table if exists bazzybar; -- reset the profiling stats
select my_function_here('lala',123); -- this line and variations as many times as you deem fit
select * from bazzybar; -- show the time spent on each line of your function
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)