mbari-org / annosaurus

Service for storing and retrieving video/image annotations from VARS
https://docs.mbari.org/annosaurus/
Apache License 2.0
1 stars 1 forks source link

Performance improvements #8

Closed hohonuuli closed 5 years ago

hohonuuli commented 5 years ago

Staff are running into performance issues when opening large sets (5000-ish annotations). The JPA makes one call to get imagedmoments followed by 4 different queries for each row. This makes it too IO intensive. My plan is to add a flattened annotation view to the database that pre-joins the tables needed to represent an annotation row in a UI. This will have the same fields as an annotation with the following exceptions:

I'll create another API endpoint with the same GET methods as the Annotation API. Only GET methods should be needed as creation/update/delete from the existing endpoints work fine.

Note that I will also need to add a db check when annosaurus starts up to see if it needs to create the views required for this endpoint.

hohonuuli commented 5 years ago

This has been addressed in release 0.2.9. The bulk of this work is in JdbcRepository.

I took a different tack than proposed. No views were created, I make a SQL call to get the imagedMoment/observation as an annotation, then one pass each for imagereferences, associations and, if requested, the ancillary data.

hohonuuli commented 5 years ago

See also https://mbari1.atlassian.net/browse/M3-7