-
Notifications
You must be signed in to change notification settings - Fork 38
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
db: improve belief search with new index #992
Conversation
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To do: we'll need to set a new minimum timely-beliefs requirement after it's released.
flexmeasures/data/migrations/versions/977f366a62df_add_quad_search_index_for_beliefs.py
Outdated
Show resolved
Hide resolved
flexmeasures/data/migrations/versions/977f366a62df_add_quad_search_index_for_beliefs.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
The more crucial reason to depend on a higher timely-beliefs version is SeitaBV/timely-beliefs#166 That one gets more bang for the buck. We should merge both for a new version, if possible. |
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
@Flix6x Will you add the minimum timely-beliefs version in this PR when preparing a (dev/patch?) release? |
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
* make upgrading removing-obsolete-tables migration more stable Signed-off-by: Nicolas Höning <nicolas@seita.nl> * re-do migration, as we do not add the UNIQUE index after all Signed-off-by: Nicolas Höning <nicolas@seita.nl> * remove alembic comments Signed-off-by: Nicolas Höning <nicolas@seita.nl> * re-do migration based on changes in TB#167 Signed-off-by: Nicolas Höning <nicolas@seita.nl> * chore: upgrade minimum requirement Signed-off-by: F.N. Claessen <felix@seita.nl> * docs: changelog entry Signed-off-by: F.N. Claessen <felix@seita.nl> --------- Signed-off-by: Nicolas Höning <nicolas@seita.nl> Signed-off-by: F.N. Claessen <felix@seita.nl> Co-authored-by: F.N. Claessen <felix@seita.nl> Signed-off-by: F.N. Claessen <felix@seita.nl>
Description
Loading beliefs takes too long. Next to a subquery improvement in timely-beliefs, we can also add an index on the 4 fields which usually are part of the queries. PR TB#167 makes sure a db migration catches the new index.
This PR includes this migration for FlexMeasures.
Look & Feel
flexmeasures db upgrade
How to test
In this PR I describe a small script to test the speedup (between before and after this migration).
I actually did not see a giant speedup, when the subquery optimization from TB#166 is already there. Without it, it can do a 50% improvement.