Hi, When we run prepared statements, as far as I know, running EXPLAIN is the only way to know whether executed plans are generic or custom. There seems no way to know how many times a prepared statement was executed as generic and custom.
I think it may be useful to record the number of generic and custom plans mainly to ensure the prepared statements are executed as expected plan type. If people also feel it's useful, I'm going to think about adding columns such as 'generic plans' and 'custom plans' to pg_stat_statements. As you know, pg_stat_statements can now track not only 'calls' but 'plans', so we can presume which plan type was executed from them. When both 'calls' and 'plans' were incremented, plan type would be custom. When only 'calls' was incremented, it would be generic. But considering the case such as only the plan phase has succeeded and the execution phase has failed, this presumption can be wrong. Thoughts? Regards, -- Atsushi Torikoshi