Isso me levou um tempo para descobrir e eu encontrei a resposta em uma wiki em língua estrangeira um número de semanas atrás, e ele foi muito útil, então eu pensei que eu iria partilhar.
Como faço para ativar a função profiler PostgreSQL?
votos
12
1 respostas
votos 9
9
No PostgreSQL 8.3 em Win32, o plugin de perfil é instalado por padrão, mas não carregado. Apenas executar esse SQL:
LOAD '$libdir/plugins/plugin_profiler.dll';
SET plpgsql.profiler_tablename = 'bazzybar';
... e então quando você deseja criar um perfil de algum código,
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













