Skip to content

Add support for pushdown of UNION queries when they all query the remote #85

@theory

Description

@theory

From the Postgres Hackers Discord:

@theory: In an FDW, is there a way to push down a union query when each select within it is from a foreign table?

@Robert Haas: i'm not sure if it's possible, but if it is possible, i would guess that it involves GetForeignUpperPaths

@theory: I need a tutorial for this stuff…

@tgl: In principle we could support that I think, but I bet there's missing infrastructure that would make it hard. In the case of joins there's some in-core code that recognizes when all the joined tables belong to the same FDW, but I don't think prepunion.c has any equivalent. If you're excited about this I suggest working on a patch for that, rather than trying to figure out how to do it without any core support.

@theory: Thanks, super useful information. Will keep it in my mental backlog for sure as I work through learning the FDW stuff, see where there are gaps, and figure out which to try to plug first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpushdownImprovements to query pushdown

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions