Thread performance optimization

pull/184/head
M66B 4 years ago
parent 52211b6a8a
commit ba7e6c10b4

@ -217,11 +217,15 @@ public interface DaoMessage {
" WHERE message.account = :account" + " WHERE message.account = :account" +
" AND message.thread = :thread" + " AND message.thread = :thread" +
" AND (:id IS NULL OR message.id = :id)" + " AND (:id IS NULL OR message.id = :id)" +
" AND (NOT :filter_archive OR folder.type <> '" + EntityFolder.ARCHIVE + " AND (NOT :filter_archive" +
"' OR (SELECT COUNT(m.id) FROM message m" + " OR folder.type <> '" + EntityFolder.ARCHIVE + "'" +
" WHERE m.account = message.account" + " OR NOT EXISTS" +
" (SELECT * FROM message m" +
" WHERE m.id <> message.id" +
" AND m.account = message.account" +
" AND m.thread = message.thread" +
" AND (m.hash = message.hash OR m.msgid = message.msgid)" + " AND (m.hash = message.hash OR m.msgid = message.msgid)" +
" AND NOT m.ui_hide) = 1)" + " AND NOT m.ui_hide))" +
" AND (NOT message.ui_hide OR :debug)" + " AND (NOT message.ui_hide OR :debug)" +
" ORDER BY CASE WHEN :ascending THEN message.received ELSE -message.received END" + " ORDER BY CASE WHEN :ascending THEN message.received ELSE -message.received END" +
", CASE" + ", CASE" +

Loading…
Cancel
Save