Remove unnecessary joins

This commit is contained in:
Dan Stillman 2010-12-13 22:10:06 +00:00
parent 2f7bf480c0
commit 07c450acbf

View File

@ -522,8 +522,7 @@ Zotero.Items = new function() {
// Then try editors
"CASE (" +
"SELECT COUNT(*) FROM itemCreators " +
"NATURAL JOIN creatorTypes WHERE itemID=I.itemID AND creatorTypeID IN (3)" +
"SELECT COUNT(*) FROM itemCreators WHERE itemID=I.itemID AND creatorTypeID IN (3)" +
") " +
"WHEN 0 THEN NULL " +
"WHEN 1 THEN (" +
@ -549,8 +548,7 @@ Zotero.Items = new function() {
// Then try contributors
"CASE (" +
"SELECT COUNT(*) FROM itemCreators " +
"NATURAL JOIN creatorTypes WHERE itemID=I.itemID AND creatorTypeID IN (2)" +
"SELECT COUNT(*) FROM itemCreators WHERE itemID=I.itemID AND creatorTypeID IN (2)" +
") " +
"WHEN 0 THEN NULL " +
"WHEN 1 THEN (" +