Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GROUP BY in joined subqueries #10

Open
VernonVega opened this issue Sep 5, 2019 · 1 comment
Open

GROUP BY in joined subqueries #10

VernonVega opened this issue Sep 5, 2019 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@VernonVega
Copy link

FDW seems to not pushdown JOIN of subqueries if they contain GROUP BY inside.

SELECT * FROM 
(
SELECT sale_id FROM sales
) a
JOIN
(
SELECT sale_id, product_id FROM products
) b ON a.sale_id = b.sale_id

Lets say both tables (sales and products) are foreign tables.
Previous query seems to work well but next query seems to not pushdown join.

SELECT * FROM 
(
SELECT sale_id FROM sales
GROUP BY  sale_id
) a
JOIN
(
SELECT sale_id, product_id FROM products
) b ON a.sale_id = b.sale_id

Is there any way to change this behaviour?

@ildus
Copy link
Owner

ildus commented Sep 12, 2019

For now clickhouse_fdw mostly does same thing as postgres_fdw. And additional features like these will require a lot more thinking and analysing, for what I do not have enough time right now. It's easy to implement exact feature, but hard to predict that it would not broke other things in planner.

@ildus ildus added the help wanted Extra attention is needed label Sep 12, 2019
ildus pushed a commit that referenced this issue Oct 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants