Closed empt-ak closed 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
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
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.