如何启用PostgreSQL函数探查器?
我花了一段时间才弄明白,几周前我在一个外语维基上找到了答案,它非常有用,所以我想我会与大家分享。在Win32上的PostgreSQL 8.3上,分析插件默认安装,但没有加载。只需执行以下SQL:如何启用PostgreSQL函数探查器?,postgresql,function,profiling,plpgsql,Postgresql,Function,Profiling,Plpgsql,我花了一段时间才弄明白,几周前我在一个外语维基上找到了答案,它非常有用,所以我想我会与大家分享。在Win32上的PostgreSQL 8.3上,分析插件默认安装,但没有加载。只需执行以下SQL: LOAD '$libdir/plugins/plugin_profiler.dll'; SET plpgsql.profiler_tablename = 'bazzybar'; …然后当你想分析一些代码时 drop table if exists bazzybar; -- reset the prof
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