Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何启用PostgreSQL函数探查器?_Postgresql_Function_Profiling_Plpgsql - Fatal编程技术网

如何启用PostgreSQL函数探查器?

如何启用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

我花了一段时间才弄明白,几周前我在一个外语维基上找到了答案,它非常有用,所以我想我会与大家分享。

在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