Problem
For a large number of distinct tags the current implementation of the TagTranslator is inefficient because it needs to run on query per tag against its keytables-connection.
Possible solution
This is of course inevitable if the tags to be fetched are unknown.
But the OSHDBQuery could be seperated into two queries with the first fetching all desired OSHDBTags. Then a method (e.g. TagTranslator.prefetch(List<OSHDBTag> tags) to query a large number of tags at once would be needed.
Additional context
This link might be helpful on how to implement batch-tag-fetiching:
Problem
For a large number of distinct tags the current implementation of the TagTranslator is inefficient because it needs to run on query per tag against its keytables-connection.
Possible solution
This is of course inevitable if the tags to be fetched are unknown.
But the OSHDBQuery could be seperated into two queries with the first fetching all desired OSHDBTags. Then a method (e.g.
TagTranslator.prefetch(List<OSHDBTag> tags)to query a large number of tags at once would be needed.Additional context
This link might be helpful on how to implement batch-tag-fetiching: