Skip to content

feat(mysql): add aggregate pushdown support for MySQL FDW#596

Merged
burmecia merged 3 commits into
mainfrom
bo/feat/mysql-aggregate
May 4, 2026
Merged

feat(mysql): add aggregate pushdown support for MySQL FDW#596
burmecia merged 3 commits into
mainfrom
bo/feat/mysql-aggregate

Conversation

@burmecia
Copy link
Copy Markdown
Member

@burmecia burmecia commented May 4, 2026

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 by over plain columns, with or without a where clause. Pushdown also works when the foreign table option is a sub-query.

Additional context

N/A

Copilot AI review requested due to automatic review settings May 4, 2026 02:37
@burmecia burmecia added the mysql label May 4, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread docs/catalog/mysql.md
Comment thread wrappers/src/fdw/mysql_fdw/mysql_fdw.rs Outdated
Comment thread wrappers/src/fdw/mysql_fdw/tests.rs
burmecia and others added 2 commits May 4, 2026 13:01
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@burmecia burmecia requested a review from imor May 4, 2026 03:30
@burmecia burmecia merged commit e139cf0 into main May 4, 2026
7 checks passed
@burmecia burmecia deleted the bo/feat/mysql-aggregate branch May 4, 2026 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants