sql >> Base de Datos >  >> RDS >> PostgreSQL

¿Cómo habilito el perfilador de funciones de PostgreSQL?

En PostgreSQL 8.3 en Win32, el complemento de generación de perfiles se instala de forma predeterminada, pero no se carga. Simplemente ejecute este SQL:

LOAD '$libdir/plugins/plugin_profiler.dll';
SET plpgsql.profiler_tablename = 'bazzybar';

...y luego, cuando desee perfilar algún 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