Skip to content

Offload entry root slice to QE#385

Merged
my-ship-it merged 1 commit intoapache:mainfrom
Ray-Eldath:offload-entry-to-qe/modify
Mar 19, 2024
Merged

Offload entry root slice to QE#385
my-ship-it merged 1 commit intoapache:mainfrom
Ray-Eldath:offload-entry-to-qe/modify

Conversation

@Ray-Eldath
Copy link
Copy Markdown
Contributor

@Ray-Eldath Ray-Eldath commented Feb 28, 2024

For some queries, Sort, (Finalized) Aggregate and Join are executed on QD, which increase workload on a single point. This PR alleviates this by offloading these operators to a QE. Specifically, it checks whether the root slice (the slice of the Plan before it meets the first Motion) contains these operators in should_offload_entry_to_qe_plan_walker, then it checks whether the offloading can be performed safely in safe_to_offload_entry_to_qe_rte_walker by walking the range table. This implementation specifically does not rely on RelOptInfo or anything postgres-optimizer-specific so that we can port this to Orca in the future.

@Ray-Eldath Ray-Eldath force-pushed the offload-entry-to-qe/modify branch 3 times, most recently from eb7f7fc to e5e074f Compare February 29, 2024 07:01
Comment thread src/backend/utils/misc/guc_gp.c Outdated
Comment thread src/test/regress/sql/offload_entry_to_qe.sql Outdated
Comment thread src/test/regress/expected/offload_entry_to_qe.out Outdated
@Ray-Eldath Ray-Eldath force-pushed the offload-entry-to-qe/modify branch 3 times, most recently from e9ae87e to ec724c3 Compare March 1, 2024 08:44
Comment thread src/test/regress/expected/offload_entry_to_qe.out Outdated
Comment thread src/backend/optimizer/plan/createplan.c
@Ray-Eldath Ray-Eldath force-pushed the offload-entry-to-qe/modify branch 3 times, most recently from 6229fcb to 58a5e51 Compare March 6, 2024 03:42
Comment thread src/backend/optimizer/plan/createplan.c
Copy link
Copy Markdown
Contributor

@avamingli avamingli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Comment thread src/backend/optimizer/plan/createplan.c
Comment thread src/backend/optimizer/plan/createplan.c
Comment thread src/backend/optimizer/plan/createplan.c
Comment thread src/backend/optimizer/plan/createplan.c
Comment thread src/backend/optimizer/plan/createplan.c
Comment thread src/backend/optimizer/plan/createplan.c
@Ray-Eldath Ray-Eldath force-pushed the offload-entry-to-qe/modify branch from 58a5e51 to b3dfabf Compare March 12, 2024 06:47
Comment thread src/test/regress/sql/offload_entry_to_qe.sql
@Ray-Eldath Ray-Eldath force-pushed the offload-entry-to-qe/modify branch from b3dfabf to 1a92883 Compare March 14, 2024 08:06
Comment thread src/backend/optimizer/plan/planner.c Outdated
Comment thread src/test/regress/sql/offload_entry_to_qe.sql
Comment thread src/test/regress/sql/offload_entry_to_qe.sql
@Ray-Eldath Ray-Eldath force-pushed the offload-entry-to-qe/modify branch 2 times, most recently from c5cb4c9 to d472c6b Compare March 18, 2024 06:36
@Ray-Eldath Ray-Eldath requested a review from yjhjstz March 18, 2024 07:13
Comment thread src/backend/optimizer/plan/createplan.c Outdated
@Ray-Eldath Ray-Eldath force-pushed the offload-entry-to-qe/modify branch from d472c6b to 6bab2a3 Compare March 18, 2024 09:15
Comment thread src/backend/optimizer/plan/createplan.c Outdated
Comment thread src/backend/optimizer/plan/createplan.c Outdated
Comment thread src/test/regress/sql/offload_entry_to_qe.sql
For some queries, Sort, (Finalized) Aggregate and Join are executed on
QD, which increase workload on a single point. This PR alleviates this
by offloading these operators to a QE. Specifically, it checks whether
the root slice (the slice of the Plan before it meets the first Motion)
contains these operators in should_offload_entry_to_qe_plan_walker, then
it checks whether the offloading can be performed safely in
safe_to_offload_entry_to_qe_rte_walker by walking the range table.
This implementation specifically does not rely on RelOptInfo or anything
postgres-optimizer-specific so that we can port this to Orca in the
future.
@Ray-Eldath Ray-Eldath force-pushed the offload-entry-to-qe/modify branch from 6bab2a3 to b7fb8d0 Compare March 18, 2024 09:26
@Ray-Eldath
Copy link
Copy Markdown
Contributor Author

@my-ship-it Maybe merge this as well? :)

@my-ship-it my-ship-it merged commit b3b1198 into apache:main Mar 19, 2024
foreyes pushed a commit to foreyes/cloudberrydb that referenced this pull request Jul 8, 2024
For some queries, Sort, (Finalized) Aggregate and Join are executed on
QD, which increase workload on a single point. This PR alleviates this
by offloading these operators to a QE. Specifically, it checks whether
the root slice (the slice of the Plan before it meets the first Motion)
contains these operators in should_offload_entry_to_qe_plan_walker, then
it checks whether the offloading can be performed safely in
safe_to_offload_entry_to_qe_rte_walker by walking the range table.
This implementation specifically does not rely on RelOptInfo or anything
postgres-optimizer-specific so that we can port this to Orca in the
future.
tuhaihe pushed a commit to tuhaihe/cloudberrydb that referenced this pull request Jan 26, 2026
tuhaihe pushed a commit to tuhaihe/cloudberrydb that referenced this pull request Feb 26, 2026
tuhaihe pushed a commit to tuhaihe/cloudberrydb that referenced this pull request Feb 27, 2026
reshke pushed a commit that referenced this pull request Mar 11, 2026
reshke pushed a commit to reshke/cloudberrydb that referenced this pull request Mar 11, 2026
reshke pushed a commit to reshke/cloudberrydb that referenced this pull request Mar 12, 2026
reshke pushed a commit to reshke/cloudberrydb that referenced this pull request Mar 12, 2026
oppenheimer01 pushed a commit to oppenheimer01/cloudberrydb that referenced this pull request Apr 12, 2026
oppenheimer01 pushed a commit to oppenheimer01/cloudberrydb that referenced this pull request Apr 21, 2026
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.

4 participants