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

Intensity map optimisations #1

Closed
ammojamo opened this issue Feb 25, 2019 · 0 comments
Closed

Intensity map optimisations #1

ammojamo opened this issue Feb 25, 2019 · 0 comments

Comments

@ammojamo
Copy link
Collaborator

(See email TSX website logs 28 Nov 2018)

The intensity map API endpoint ('/lpi-data/intensity') is really slow.

It is generating an SQL query which contains all of the 10,000+ time series IDs in it, which is massive. This is the offending line: https://github.com/nesp-tsr3-1/tsx/blame/62a2e4fc549c0a534409d111a8468f7275b55138/tsx/api/lpi_data.py#L139 . It would be a lot faster to perform the filtering in SQL instead of sending a big list of time series IDs.

I think the code that takes the result of the SQL query and converts it into JSON could also be optimised a lot (https://github.com/nesp-tsr3-1/tsx/blame/62a2e4fc549c0a534409d111a8468f7275b55138/tsx/api/lpi_data.py#L149-L151).

@ammojamo ammojamo closed this as completed Jun 8, 2023
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

No branches or pull requests

1 participant