-
Notifications
You must be signed in to change notification settings - Fork 6
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
Reduce MV insert memory usage #126
Comments
dbt model - https://github.com/openedx/aspects-dbt/blob/main/models/video/watched_video_duration.sql#L25-L36 |
We can do similar changes to other high memory models. I'll compile a list of highest memory queries and queries that have been moved out of dbt into superset which we may be able to move back |
Do you think this is a thing we can actually use to remove most of the SQL pre-where queries from Superset? It seems like it would work. |
I don't see why not. It might take some refactoring of the queries if we need to use parameters but shouldn't be too bad |
We should do a memory pass on MV inserts and see which insert paths could use tweaking. It seems like there are methods to limit the number of rows being considered on the right side of joins in MVs as documented here: https://stackoverflow.com/questions/75243697/joining-large-tables-in-clickhouse-out-of-memory-or-slow
Where possible we should implement that or projections to speed up inserts and reduce memory consumption. This comes out of an issue reporting this error:
Code: 241. DB::Exception: Memory limit (total) exceeded: would use 14.49 GiB (attempt to allocate chunk of 4238898 bytes), maximum: 13.83 GiB. OvercommitTracker decision: Query was selected to stop by OvercommitTracker.: While executing JoiningTransform: while pushing to view xapi.subsection_problem_engagement_mv (b6e66e2d-e108-463c-ae7b-17ac579daf95): while pushing to view xapi.problem_events_mv (74481e14-1e07-42a2-986e-f7a269a79079): while pushing to view xapi.xapi_events_all_parsed_mv (2831c02c-9fca-494b-b8f6-3d22dc921e72): While executing WaitForAsyncInsert. (MEMORY_LIMIT_EXCEEDED) (version 23.8.2.7 (official build))
Similar errors have been seen with
watched_video_duration
:The text was updated successfully, but these errors were encountered: