feat(mysql): add aggregate pushdown support for MySQL FDW#596
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds aggregate pushdown support to the MySQL FDW so common aggregate queries can be executed remotely in MySQL instead of being aggregated locally in Postgres. It extends the new aggregate-pushdown framework introduced in #586 and updates the MySQL FDW implementation, tests, and docs accordingly.
Changes:
- Add MySQL-specific aggregate SQL deparsing and implement the aggregate FDW hooks (
supported_aggregates,supports_group_by,begin_aggregate_scan). - Add end-to-end tests for supported aggregate pushdown behavior and a couple of non-pushdown cases.
- Update MySQL FDW versioning and documentation to advertise aggregate pushdown support.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
wrappers/src/fdw/mysql_fdw/tests.rs |
Adds aggregate pushdown integration tests for MySQL FDW. |
wrappers/src/fdw/mysql_fdw/mysql_fdw.rs |
Implements aggregate pushdown query generation and execution for MySQL. |
wrappers/src/fdw/mysql_fdw/README.md |
Bumps changelog/version notes for the MySQL FDW. |
docs/catalog/mysql.md |
Documents aggregate pushdown support, limits, and examples. |
CLAUDE.md |
Updates contributor/developer guidance to mention aggregate pushdown hooks and support matrix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
imor
approved these changes
May 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
This PR is to add aggregate pushdown support for MySQL FDW.
What is the current behavior?
Aggregate pushdown support was added to framework in #586, but MySQL FDW doesn't support it yet.
What is the new behavior?
Added aggregate pushdown support for MySQL FDW, which supports below forms of aggregates.
Supported aggregates
count(*),count(col),count(distinct col),sum(col),avg(col),min(col),max(col).Supported shapes
scalar aggregates,
group byover plain columns, with or without awhereclause. Pushdown also works when the foreigntableoption is a sub-query.Additional context
N/A