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

At-risk dashboard performance enhancements #822

Merged
merged 4 commits into from
May 23, 2024
Merged

Conversation

bmtcril
Copy link
Contributor

@bmtcril bmtcril commented May 22, 2024

This improves performance of the various charts of the at-risk dashboard. In the 300M row dataset all charts load now, though some are still slow. The problem engagement charts should be able to be improved by other changes in flight.

This also bumps platform-plugin-aspects to 0.9.4 and adds its new setting

Closes: #793
Closes: #792

@@ -15,6 +15,7 @@ EVENT_SINK_CLICKHOUSE_PII_MODELS = {{ EVENT_SINK_PII_MODELS }}

ASPECTS_INSTRUCTOR_DASHBOARDS = {{ ASPECTS_INSTRUCTOR_DASHBOARDS }}
SUPERSET_DASHBOARD_LOCALES = {{ SUPERSET_DASHBOARD_LOCALES }}
SUPERSET_SHOW_INSTRUCTOR_DASHBOARD_LINK = {{ SUPERSET_SHOW_INSTRUCTOR_DASHBOARD_LINK }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed for platform-plugin-aspects 0.9.4

tutoraspects/plugin.py Outdated Show resolved Hide resolved
Copy link
Contributor

@Ian2012 Ian2012 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of comments for the sql changes.

Comment on lines 2 to 9
page_visits as (
select org, course_key, actor_id, max(last_visited) as last_visited
from {{ ASPECTS_XAPI_DATABASE }}.fact_learner_last_course_visit
where
1=1
{% include 'openedx-assets/queries/common_filters.sql' %}
group by org, course_key, actor_id
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, usually the MV with org/course_key partition is good enough to improve the query times

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It definitely improves query times, but this does so even more. IIRC the MV took the query I was testing from running out of memory to about 12 seconds, this brought it down closer to 6.

@Ian2012
Copy link
Contributor

Ian2012 commented May 22, 2024

@bmtcril rerunning CI checks with the emission time changes: https://github.com/openedx/tutor-contrib-aspects/actions/runs/9195812496/job/25292445072?pr=822

Copy link
Contributor

@SoryRawyer SoryRawyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the SQL changes look good to me!

@bmtcril
Copy link
Contributor Author

bmtcril commented May 22, 2024

Closing/reopening to re run tests with latest dbt changes

@Ian2012 Ian2012 merged commit 8574061 into main May 23, 2024
9 checks passed
@Ian2012 Ian2012 deleted the bmtcril/at_risk_dash_fixes branch May 23, 2024 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants