yjhjstz commented on PR #1711:
URL: https://github.com/apache/cloudberry/pull/1711#issuecomment-4355065138
Thanks for the contribution! The feature addresses a real operational pain
point.
One architectural suggestion: could this be implemented as an extension
and placed under contrib/ (or gpcontrib/)? Using PostgreSQL's planner_hook, the
extension fires after the planner (including ORCA) returns the final
PlannedStmt, allowing a plan tree walk to detect missing pruning steps — which
is essentially what the ORCA path in orca.c already does. GUCs can be
registered from the extension side via
DefineCustomBoolVariable/DefineCustomIntVariable, keeping all the knobs without
touching core GUC tables.
The main trade-off is that planner_hook only sees the finished plan, while
the current standard planner path hooks mid-planning inside
expand_partitioned_rtentry() to compare num_live_parts vs nparts. For the
partition_fullscan_threshold feature this is slightly less precise — but for
the primary use case of rejecting true full scans (zero pruning steps), the
extension approach is fully equivalent.
Placing this in contrib/ would:
- Keep core optimizer files (inherit.c, orca.c, guc.c) untouched, reducing
cross-version maintenance burden
- Make the feature easier to evolve and backport independently
Would you be open to exploring that direction? Happy to discuss if there
are cases where the extension approach falls short of your requirements.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]