-
Notifications
You must be signed in to change notification settings - Fork 16
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
sqlmesh runs seem to always take hours #2109
Comments
Ok. So I've been spending maybe too much time on this but the current performance of sqlmesh + clickhouse is seemingly untenable. What we're seeing right now are a few things:
I've messed with various scaling/optimization techniques:
I don't want to abandon cilckhouse but it's defnitely giving me a bunch of headaches. I think, particularly for the way our metrics are calculated, we can do massive parallel processing, but there seems to be limited capacity for this right now. |
Hey! Curious if you have explored ClickHouse Materialized Views for this. Curious what issues you faced if that's the case! Also, ClickHouse is... a beast, but a complicated beast. Have you considered getting some consulting help? The only thing I know about ClickHouse is that the right setting and setup might make a query go from never ending to completing in milliseconds. 😅 |
@davidgasquez ya sadly I did look into materialized views but many of our queries are based on using rolling windows of last X days/months/years. Previously with bigquery we attempted to calculate this all at once by essentially generating data for all time at all times but it ended up running out of memory. It also limited the amount of recursion that one could do with those rolling windows. Now with sqlmesh we actually are generating metrics based on various dimensions by just calling a Funny enough running this with duckdb. Totally no problems haha. If only motherduck were on gcp. I think the solution really is using the All this being said, because of the way our metrics are currently calculated (each as separate tables and then joined in a view later), I think it actually fits really well with horizontally scalable architectures like Trino, starrocks, spark, or druid. Clickhouse doesn't do well with horizontal scale based on all that I've seen, but I think these others solutions might actually perform well here. Sadly it's a bit to get that setup and tested as well. |
Oh interestingly though, I'm realizing I can improve the performance of some of the upstream models that we use to calculate the metrics with materialized views. I hadn't thought about this until now but in theory that should take care of a bit part of the initial calculation's issues. Though I may have to abandon doing any testing on duckdb. This could also be used with some of the other metric aggregations that aren't rolling |
Well hrm, this might be exactly what i need: https://clickhouse.com/docs/en/sql-reference/statements/create/view#window-view-experimental but I imagine isn't supported with sqlmesh. hrmmmmm |
@ravenac95 CCed you on a thread to ask the Clickhouse folks directly. They've offered engineering support in the past. Feel free to dump questions in the thread for them to forward to the right person |
Links from the call Marcelo Rodriguez |
Worth asking the sqlmesh folks whether there is an "append/insert-only" incremental strategy that doesn't require deletes |
Going to close this in favor of a new issue to investigate sqlmesh runs. This was a bit of an all consuming issue. |
What is it?
I only wanted to copy 1 column into metrics_v0, and it turned into a multi-hour run.
Is there a bug? I guess logging could help determine this.
The text was updated successfully, but these errors were encountered: