pg_show_plans
pg_show_plans copied to clipboard
Add somekind of option to start disabled
As such troubleshooting / debugging is not always used and has a small performance impact, would be nice if the extension could start in disabled mode and one could enable it when the need arises with pg_show_plans_enable(). An alternative is of course to disable the extension from "shared_preload_libraries", but this requires server restart which might not work for all.
Hello, Here is a patch trying to answer this question by adding pg_show_plans.startup_enable GUC:
pg_show_plans.startup_enable.diff.txt
or https://github.com/legrandlegrand/pg_show_plans/pull/1
Hello! I am the new maintainer.
It seems like currently we have a redundant variable, and none of the two give the desired functionality, i.e.:
static void
pgsp_ExecutorEnd(QueryDesc *queryDesc)
{
/* Bypass the following steps if this pgsp_enable is set to false */
if (pgsp_enable)
{
/* Delete entry */
SpinLockAcquire(&pgsp->elock);
if (pgsp->is_enable)
{
SpinLockRelease(&pgsp->elock);
delete_entry(MyProcPid);
}
else
SpinLockRelease(&pgsp->elock);
}
if (prev_ExecutorEnd)
prev_ExecutorEnd(queryDesc);
else
standard_ExecutorEnd(queryDesc);
}
The execution occurs iff both *_enable
variables are set to true
. I just cannot find the difference it makes having those two in the different states.
I will try to refactor this functionality a little bit.
Alright, I got it. GUC variable disables the extension locally, and shared structure variable disables the extension globally (for all clients).