clickhouse_fdw
clickhouse_fdw copied to clipboard
GROUP BY in joined subqueries
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?
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.