12
这花了我一段时间才弄清楚,几星期前我在外语wiki上找到了答案,这非常有帮助,所以我想我会分享。如何启用PostgreSQL功能分析器?
这花了我一段时间才弄清楚,几星期前我在外语wiki上找到了答案,这非常有帮助,所以我想我会分享。如何启用PostgreSQL功能分析器?
在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