Commit Graph
1 Commits
Author SHA1 Message Date
Lauri Ojansivu e9440d503e Recurring cards: an index for the hourly job.
server/cardRecurrenceSchedule.js runs every hour and asks for the cards
with a recurrenceInterval ($exists: true, not null or 'none'). There was no
index on the field, so the query read every card in the database to find
the few that recur. One instance logged it as a slow query: COLLSCAN,
1,108,017 documents examined, 1,155 ms.

A partial index on recurrenceInterval holds only the cards that have one,
the same way activities indexes commentId and attachmentId. The job's
$exists: true lets MongoDB use it; tests/recurrenceIndex.test.cjs pins both.
From the reporter's patch.

Thanks to Raymond-Voogt and xet7 !

Fixes #6825.
2026-10-27 21:12:45 +02:00