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

SEARCH-688 (I): Use raiseload in query loading options #154

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

amCap1712
Copy link
Member

@amCap1712 amCap1712 commented Nov 7, 2022

Use raiseload loading technique in query options to raise an error on accessing attributes that haven't been eagerly loaded. There have been suboptimal SQL queries in sir previously due to missing columns in extrapaths or using hybrid attributes in fields or extrapaths which caused lazy loading. Since the attributes we access in SIR are fixed and remain the same, we should aim for loading all of those eagerly. raiseload will raise an error with a stacktrace to help us fix the issue if a lazy load happens, helping in performance debugging.

Checklist for author

  • Run a full reindex because the real data indexing data do not capture all possible relationships of data.

@amCap1712
Copy link
Member Author

I did some more testing and it caught issues in artist core but missed the ones in label core. Putting this on hold for now.

Use [raiseload](https://docs.sqlalchemy.org/en/14/orm/loading_relationships.html#sqlalchemy.orm.raiseload) loading technique in query options
to raise an error on accessing attributes that haven't been eagerly
loaded. There have been suboptimal SQL queries in sir previously due to
missing columns in extrapaths or using hybrid attributes in fields or
extrapaths which caused lazy loading. Since the attributes we access in
SIR are fixed and remain the same, we should aim for loading all of those
eagerly. raiseload will raise an error with a stacktrace to help us fix
the issue if a lazy load happens, helping in performance debugging.
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.

1 participant