krejvl / DSpace

(Official) The DSpace digital asset management system that powers your Institutional Repository
https://wiki.duraspace.org/display/DSDOC4x/Introduction
Other
1 stars 0 forks source link

Collection are multiplicated #25

Closed empt-ak closed 9 years ago

empt-ak commented 9 years ago

When method Community.getCollections() is used, entries are duplicated. This is caused by LEFT JOIN query, which is not expecting that collection has more than one title.

empt-ak commented 9 years ago

explain analyze SELECT DISTINCT(c.collection_id),logo_bitstream_id,template_item_id,workflow_step_1,workflow_step_2,workflow_step_3,submitter,admin,m.text_value FROM community2collection as c2c, collection as c, metadatavalue as m WHERE c2c.collection_id=c.collection_id AND c2c.community_id=3 and m.resource_id = c.collection_id and m.resource_type_id = 3 and m.metadata_field_id = 64 ORDER BY m.text_value

empt-ak commented 9 years ago

explain analyze SELECT DISTINCT(c.collection_id),logo_bitstream_id, template_item_id, workflow_step_1, workflow_step_2, workflow_step_3, submitter, admin,m.text_value FROM community2collection c2c, collection c LEFT JOIN metadatavalue m on (m.resource_id = c.collection_id and m.resource_type_id = 3 and m.metadata_field_id = 64) WHERE c2c.collection_id=c.collection_id AND c2c.community_id=3 ORDER BY m.text_value