2009-01-09 57 views

回答

9

在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