-
Notifications
You must be signed in to change notification settings - Fork 0
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
Adaptation options can be slow to load #160
Comments
I've been testing this to see if #159 slowed down the Adaptation tab, but I also see the same slow performance prior to that PR (v0.4.12.) |
The request for a single page (20 items) of adaptation options is taking 36s, for this particular query. This is the slow request in the code. It's only slow when the total number of items is large, so maybe this is a slow table scan in Postgres? irv-jamaica/frontend/src/app/asset-list/use-sorted-features.ts Lines 60 to 68 in 66e5bde
The same query takes 395ms in the backend running locally, so I'm inclined to think the deployed database is missing an index somewhere. |
Just had a quick look from here, can confirm the above. There are two main API calls for data here:
|
I've rolled the deployed Docker image back to 0.4.12, to remove changes I made to the data loaders yesterday. I'm still seeing these POST requests taking a long time, so I don't think I broke anything in #159. Loading large numbers of features seems to be intrinsically slow. This URL should work with 0.4.12 (there was a bug in 0.4.12 that broke the map for the URL that I posted at the top of this issue.) Running the backend locally, with docker compose, those same POST requests to get the adaptation colours take between 8ms and ~200ms. |
Adaptation options can be slow to load, when the number of features is large. Eg. Transport > Roads > Metro loads ~29k features and there's a noticeable delay.
Tested versions: 0.4.13 and 0.4.12
Tested URL: https://jamaica.infrastructureresilience.org/adaptation?lat=18.00478&lon=-76.88483&zoom=10.98&netTree=11&assets=true&hazards=false&buildings=false&buildingsStyle=type®ions=false®ionsStyle=boundaries&terrestrialStyle=landuse&droughtStyle=adaptation&hazardsStyle=&marineStyle=habitat&assetsStyle=adaptation&drought=false&terrestrial=false&marine=false
Compare with bridges, which load 412 features:
https://jamaica.infrastructureresilience.org/adaptation?lat=18.00478&lon=-76.88483&zoom=10.98&netTree=14&assets=true&hazards=false&buildings=false&buildingsStyle=type®ions=false®ionsStyle=boundaries&terrestrialStyle=landuse&droughtStyle=adaptation&hazardsStyle=&marineStyle=habitat&assetsStyle=adaptation&drought=false&terrestrial=false&marine=false
The text was updated successfully, but these errors were encountered: