Hi,

Thank you for your patch. It is really useful for tracking the history of generic and custom plan usage.

At first glance, I have the following suggestions for improvement:

1. Is there any reason for the double check of cplan != NULL? It seems unnecessary, and we could simplify it to:

-if (cplan && cplan->status == PLAN_CACHE_STATUS_CUSTOM_PLAN)
+if (cplan->status == PLAN_CACHE_STATUS_CUSTOM_PLAN)

2. Should we add Assert(kind == PGSS_EXEC) at this place  to ensure that generic_plan_calls and custom_plan_calls are only incremented when appropriate?

--
Best regards,
Ilia Evdokimov,
Tantor Labs LLC.



Reply via email to