Registry Mirror
Skip to content

Conversation

@Alena0704

Copy link
Copy Markdown
Collaborator

Sequential Append branches can retain memory after they finish producing rows. Counting only the largest branch therefore understates the number of memory-intensive operators and gives the remaining operators oversized quotas, including a Sort above several HashAggregates.

Sum memory-intensive operators across all branches for both auto and eager_free, including child-group roots counted in the parent group. Keep the maximum fixed-memory allowance for sequential branches so that queries over many partitions can still run with a small statement budget.

Add quota tests for the other memory-intensive node types, aggregate variants, nested and mixed Append branches, common and branch SubPlans, external parameters, concurrent branches, and the no-spill budget helper. Clarify the partition regression test's memory-lifetime comment.

Fixed: #2446

Fixes #ISSUE_Number

What does this PR do?

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

Additional Context


Sequential Append branches can retain memory after they finish producing
rows. Counting only the largest branch therefore understates the number
of memory-intensive operators and gives the remaining operators oversized
quotas, including a Sort above several HashAggregates.

Sum memory-intensive operators across all branches for both auto and
eager_free, including child-group roots counted in the parent group.
Keep the maximum fixed-memory allowance for sequential branches so that
queries over many partitions can still run with a small statement budget.

Add quota tests for the other memory-intensive node types, aggregate
variants, nested and mixed Append branches, common and branch SubPlans,
external parameters, concurrent branches, and the no-spill budget helper.
Clarify the partition regression test's memory-lifetime comment.

Fixed: apache#2446
@Alena0704
Alena0704 requested a review from yjhjstz December 3, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Window Sort above ROLLUP gets a larger memory quota and runs slower after "Reserve memory for one partition at a time"

1 participant