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

Transformers - Materialize APR tables #98

Merged
merged 3 commits into from
Aug 13, 2024

Conversation

marcus-snx
Copy link
Contributor

Streamlit is querying the APR views, and due to the WHERE combined filter on timestamp and pool_id the query plan selects a very slow path.

Solution:

  • materialize the views as tables (removes the nested loop due to the complicated JOINs in the view)
  • drawback: doubles the dbt run time (which right now is quite fast so it's not an actual problem for the time being

Another possible solution is to try and 'fool' the query planner to first filter solely on timestamp or pool_id (which is fast even with a view).

@marcus-snx marcus-snx requested a review from Tburm August 12, 2024 22:54
@marcus-snx marcus-snx mentioned this pull request Aug 13, 2024
@Tburm Tburm merged commit eb35041 into main Aug 13, 2024
2 checks passed
@Tburm Tburm deleted the transformers/materialize-apr-models branch August 13, 2024 21:24
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

Successfully merging this pull request may close these issues.

2 participants