ORCA: fallback the locking clause
Fixes #1031
What does this PR do?
If the current GDD is closed and there is a forupdate statement, ORCA and planner does not need to generate a LockRows operator, expect the table is foreign table. However, if the current GDD is enabled, ORCA will generate a plan without the LockRows operator, which is a wrong plan.
Supporting locking clauses in ORCA is a very difficult thing. Because ORCA does not fill root->glob->paramExecTypes in every operator, even if ORCA generates the LockRows operator, it may not working in the executor. For details, please refer to the EPQ(evalPlanQual) mechanism.
Also I don't think ORCA should consider supporting locking clause. ORCA is an optimizer that is more biased towards OLAP scenarios. Support the EPQ mechanism will make ORCA more complex and more difficult to expand.
Type of Change
- [ ] Bug fix (non-breaking change)
- [ ] New feature (non-breaking change)
- [ ] Breaking change (fix or feature with breaking changes)
- [ ] Documentation update
Breaking Changes
Test Plan
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Passed
make installcheck - [ ] Passed
make -C src/test installcheck-cbdb-parallel
Impact
Performance:
User-facing changes:
Dependencies:
Checklist
- [ ] Followed contribution guide
- [ ] Added/updated documentation
- [ ] Reviewed code for security implications
- [ ] Requested review from cloudberry committers