hydroserver2 / hydroserver

Documentation and issue tracker for HydroServer and related applications
BSD 3-Clause "New" or "Revised" License
5 stars 0 forks source link

SensorThings - Don't calculate count if not requested #124

Closed kjlippold closed 7 months ago

kjlippold commented 7 months ago

Describe the feature you'd like and what it will do

The SensorThings API currently calculates a count value for all GET requests. The count only needs to be calculated if a user asks for it to be included in the SensorThings response.

Why is this feature important?

The auth-filtered count calculation on the full Observations table is fairly CPU intensive and can cause paginated requests on the Observations endpoint without the count value included to take several seconds even for a small subset of data. Ignoring the count unless the user requests it speeds up this query significantly.

Is your feature request related to a problem? Please describe.

No response

Any additional comments?

No response

kjlippold commented 7 months ago

https://github.com/hydroserver2/hydroserver-webapp-back/tree/124-sensorthings-count-optimization