Re: track generic and custom plans in pg_stat_statements - Mailing list pgsql-hackers

From Ilia Evdokimov
Subject Re: track generic and custom plans in pg_stat_statements
Date
Msg-id 6f5b6a25-7391-4233-9238-7ba4f5563ef8@tantorlabs.com
Whole thread Raw
In response to Re: track generic and custom plans in pg_stat_statements  (Sami Imseih <samimseih@gmail.com>)
Responses Re: track generic and custom plans in pg_stat_statements
List pgsql-hackers
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.




pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: new commitfest transition guidance
Next
From: Jeff Davis
Date:
Subject: Re: Statistics Import and Export