2009-01-09 81 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