12

これを理解するのにしばらく時間がかかり、数週間前に外国語のウィキで答えを見つけました。それは非常に役に立ちました。

4

1 に答える 1

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
于 2009-01-09T23:31:08.693 に答える