Add some new hooks so extensions can add details to EXPLAIN. Specifically, add a per-node hook that is called after the per-node information has been displayed but before we display children, and a per-query hook that is called after existing query-level information is printed. This assumes that extension-added information should always go at the end rather than the beginning or the middle, but that seems like an acceptable limitation for simplicity. It also assumes that extensions will only want to add information, not remove or reformat existing details; those also seem like acceptable restrictions, at least for now.
If multiple EXPLAIN extensions are used, the order in which any additional details are printed is likely to depend on the order in which the modules are loaded. That seems OK, since the user may have opinions about the order in which output should appear, and the extension author can't really know whether their stuff is more or less important to a particular user than some other extension. Discussion: http://postgr.es/m/ca+tgmoyszg58hpubmei46o8d3skx+szoo4k_agqgwirzvra...@mail.gmail.com Reviewed-by: Srinath Reddy <srinath2...@gmail.com> Reviewed-by: Andrei Lepikhov <lepi...@gmail.com> Reviewed-by: Tom Lane <t...@sss.pgh.pa.us> Reviewed-by: Sami Imseih <samims...@gmail.com> Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/4fd02bf7cf94c3b6807dcf0b13e076de94f1e4ff Modified Files -------------- src/backend/commands/explain.c | 13 +++++++++++++ src/include/commands/explain.h | 17 +++++++++++++++++ 2 files changed, 30 insertions(+)