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 and aggregate functions seems to not be mapped and forwarded. #5

Open
thebf opened this issue Feb 17, 2019 · 0 comments
Open

Comments

@thebf
Copy link

thebf commented Feb 17, 2019

Test-query:
select fr_item,sum(quantity),transaction_week from transaction_treated where transaction_year = 2019 group by fr_item,transaction_week

Running query directly in Clickhouse returns the expected result with this summary:
3265 rows in set. Elapsed: 0.060 sec. Processed 411.75 thousand rows, 6.59 MB (6.90 million rows/s., 110.47 MB/s.)

Running the same query against the foreign table in PG returns the following plan and resulting execution time:

QUERY PLAN
GroupAggregate (cost=20.00..1530749.21 rows=1 width=12) (actual time=133.919..14199.340 rows=3265 loops=1)
Group Key: fr_item, transaction_week
-> Foreign Scan on transaction_treated (cost=20.00..1530032.00 rows=95627 width=12) (actual time=133.779..14128.219 rows=95627 loops=1)
Filter: (transaction_year = 2019)
Multicorn: SELECT transaction_week, transaction_year, fr_item, quantity
Multicorn: FROM transaction_treated
Multicorn: WHERE transaction_year = 2019
Multicorn: ORDER BY fr_item, transaction_week
Planning time: 13.510 ms
Execution time: 14200.668 ms

Being able to forward group by and simple aggregates like count and sum would increase the general value of this component in a lot of use-cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant