sw360portal
sw360portal copied to clipboard
Redundant loading of information from the database when searching releases by name
When searching for releases by name (e.g. when linking projects to releases), information is loaded redundantly from the CouchDB:
@View(name = "byname", map = BY_NAME_VIEW)
public List<Release> searchByNamePrefix(String name) {
return makeSummary(SummaryType.SHORT, queryForIdsByPrefix("byname", name));
}
in this file.
- The IDs of the relevant releases are queried from the database (
queryForIdsByPrefix
). For this, whole documents are loaded from the database and then stripped to obtain only the ID-strings. - In a next step, the data is loaded from the database for the given IDs (
makeSummary
). This again loads complete documents from the database to get the information that was stripped in step 1 (see this).
- This could be improved.
- Does something similar also occur at different places in the code?