Revert "Message query optimization"

This reverts commit 8dfe39473c.
This commit is contained in:
M66B 2020-04-29 11:19:02 +02:00
parent bbc550ef1d
commit 47c94d3513
1 changed files with 6 additions and 6 deletions

View File

@ -60,14 +60,14 @@ public interface DaoMessage {
" WHEN NOT message.msgid IS NULL THEN message.msgid" +
" ELSE message.id END) AS visible" +
", SUM(message.total) AS totalSize" +
", message.priority AS ui_priority" +
", message.importance AS ui_importance" +
", MAX(message.priority) AS ui_priority" +
", MAX(message.importance) AS ui_importance" +
", MAX(CASE WHEN" +
" ((:found AND folder.type <> '" + EntityFolder.ARCHIVE + "' AND folder.type <> '" + EntityFolder.DRAFTS + "')" +
" OR (NOT :found AND :type IS NULL AND folder.unified)" +
" OR (NOT :found AND folder.type = :type))" +
" THEN message.received ELSE 0 END) AS dummy" +
" FROM message" +
" FROM (SELECT * FROM message ORDER BY received DESC) AS message" +
" JOIN account_view AS account ON account.id = message.account" +
" LEFT JOIN identity_view AS identity ON identity.id = message.identity" +
" JOIN folder_view AS folder ON folder.id = message.folder" +
@ -123,10 +123,10 @@ public interface DaoMessage {
" WHEN NOT message.msgid IS NULL THEN message.msgid" +
" ELSE message.id END) AS visible" +
", SUM(message.total) AS totalSize" +
", message.priority AS ui_priority" +
", message.importance AS ui_importance" +
", MAX(message.priority) AS ui_priority" +
", MAX(message.importance) AS ui_importance" +
", MAX(CASE WHEN folder.id = :folder THEN message.received ELSE 0 END) AS dummy" +
" FROM message" +
" FROM (SELECT * FROM message ORDER BY received DESC) AS message" +
" JOIN account_view AS account ON account.id = message.account" +
" LEFT JOIN identity_view AS identity ON identity.id = message.identity" +
" JOIN folder_view AS folder ON folder.id = message.folder" +