#2307 closed enhancement (fixed)

Implement an API for simple and fast loading of annotation values

Reported by: Nicklas Nordborg Owned by: everyone
Priority: major Milestone: BASE 3.19.10
Component: core Version:
Keywords: Cc:

Description (last modified by Nicklas Nordborg)

The regular API for loading annotation values is very slow since each value require several SQL queries against the database. The Snapshot API improve things a lot, but the values need to be cached before there is a big improvement.

In some cases we are only interested in getting the values for a single annotation type for a lot (=several thousands) of items. SQL-wise this could be implemented as a single query against the database and this would probably be very quick to execute. To keep things simple we should only load raw values as they are, which means:

  • No unit conversions are applied (this has to be done in the calling code)
  • Annotation types that support multiple values for a single item are not returned as lists, but as multiple entries in the result.
  • No sorting or filtering
  • For annotation types that support project-specific values, default values and values for the currently active project are returned but it also possible to specify a different project and/or exclude default values.

Change History (4)

comment:1 by Nicklas Nordborg, 14 months ago

In 8161:

References #2307: Implement an API for simple and fast loading of annotation values

A first version is now available in the FastAnnotationLoader class. It can be created by calling AnnotationType.getFastLoader().

comment:2 by Nicklas Nordborg, 14 months ago

In 8162:

References #2307: Implement an API for simple and fast loading of annotation values

Added more options for loading values for annotation types that has project-specific annotations.

comment:3 by Nicklas Nordborg, 14 months ago

Description: modified (diff)

comment:4 by Nicklas Nordborg, 14 months ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.