Just a helpful hint on how to make your query much quicker and easier to type and likely more efficient (better performance)! I know we all "have our ways", but it works great and is very easy to read. Here's how I would've coded the second query:
Your SQL: SELECT * FROM metadatavalue,metadatafieldregistry WHERE metadatavalue.metadata_field_id = metadatafieldregistry.metadata_field_id AND element = 'identifier' AND qualifier = 'uri' AND text_lang is NULL;
My SQL:
Option 1: SELECT *
FROM metadatavalue mv
, metadatafieldregistry mr
WHERE mv.metadata_field_id = mr.metadata_field_id
AND mr.element = ‘identifier’
AND mr.qualifier = ‘uri’
AND mv.text_lang IS NULL;
Option 2: (better) SELECT <only the columns you need)
FROM metadatavalue mv
, metadatafieldregistry mr
WHERE mv.metadata_field_id = mr.metadata_field_id
AND mr.element = ‘identifier’
AND mr.qualifier = ‘uri’
AND mv.text_lang IS NULL;
Option 3: (best) SELECT <only the columns you need)
FROM metadatavalue
WHERE metadata_field_id = 25 /* identifier.uri */
AND text_lang IS NULL;
Best regards,
Sue
Sue Walker-Thornton
(w): (757) 864-2368
(m): (757) 506-9903
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
DSpace-tech mailing list