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" +
" AND message.thread = :thread" +
" AND (:id IS NULL OR message.id = :id)" +
" AND (NOT :filter_archive OR folder.type <> '" + EntityFolder.ARCHIVE +
"' OR (SELECT COUNT(m.id) FROM message m" +
" WHERE m.account = message.account" +
" AND (NOT :filter_archive" +
" OR folder.type <> '" + EntityFolder.ARCHIVE + "'" +
" 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 NOT m.ui_hide) = 1)" +
" AND NOT m.ui_hide))" +
" AND (NOT message.ui_hide OR :debug)" +
" ORDER BY CASE WHEN :ascending THEN message.received ELSE -message.received END" +
", CASE" +

Loading…
Cancel
Save