-
Notifications
You must be signed in to change notification settings - Fork 69
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
Convert covidcast signal OR clauses to UNION #763
Comments
Here is where we parse source-signal pairs out of the API request: delphi-epidata/src/server/endpoints/covidcast.py Lines 46 to 57 in b8aaab8
Here is where we set the source-signal filters in the WHERE clause of the SQL query we're building:
We're currently just doing an append, which treats multiple source-signal pairs like an OR: delphi-epidata/src/server/_query.py Lines 434 to 452 in b8aaab8
Here is where a list of conditions get turned into an AND of ORs: delphi-epidata/src/server/_query.py Lines 360 to 366 in b8aaab8
...where we want signals in particular to turn into UNIONs |
Tests of the server code should live in here if they do not access a database: https://github.com/cmu-delphi/delphi-epidata/tree/dev/tests/server and in here if they do access a database: https://github.com/cmu-delphi/delphi-epidata/tree/dev/integrations/server |
we now have a different schema with better indexes compared to when this issue was created. its not clear that this change will still be effective. |
I just tested the queries from the opening comment of this issue against the newer |
The following query returns 248 rows and takes 30 minutes to compute:
Either one of the signals on its own runs in less than 1s each, as does the UNION of the two:
If possible, we should switch how we build multiple-signal queries to use UNION instead of OR.
The text was updated successfully, but these errors were encountered: