We need to develop a report of a batch of products which, among other information, contains the names and some medata of the images that are stored in mediabin for each product. So it is not necessary to retrieve the whole image.
You may try using the database report view ReportAssetMetaData. Suppose the identifiers of those "some metadata" are md1_id, md2_id, ..., and md3_id, then you may use the following SQL query to retrieve the asset data in one query:SELECT * FROM ReportAssetMetaData WHERE asset_id IN ( SELECT amd.asset_id FROM ReportAssetMetaData amd, MetaDataCatalog mdc WHERE mdc.name = 'product ID' AND amd.metadata_id = mdc.id AND amd.metadata_value in ( '123', '345', '346', '347', '9876' ) ) AND metadata_id IN ( 'md1_id', 'md2_id', ..., 'mdn_id' ) ORDER BY asset_name