summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2018-08-28 21:01:55 +0300
committerLauri Ojansivu <x@xet7.org>2018-08-28 21:01:55 +0300
commit4e12bcc378d96c7227fbd3f40233502b0739347d (patch)
tree3c5adda1fca87e8edf2c19a3022f4b5d1724f0ff
parent6cec3b36de356484e49d5472cad121c81e5095dd (diff)
downloadwekan-4e12bcc378d96c7227fbd3f40233502b0739347d.tar.gz
wekan-4e12bcc378d96c7227fbd3f40233502b0739347d.tar.bz2
wekan-4e12bcc378d96c7227fbd3f40233502b0739347d.zip
- Add Missing Index on cards.parentId since Swimlane integration
to speedup Wekan. Thanks to Clement87 ! Closes #1863
-rw-r--r--models/cards.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/models/cards.js b/models/cards.js
index 302beddc..4a73bbbc 100644
--- a/models/cards.js
+++ b/models/cards.js
@@ -1017,6 +1017,12 @@ if (Meteor.isServer) {
// queries more efficient.
Meteor.startup(() => {
Cards._collection._ensureIndex({boardId: 1, createdAt: -1});
+ // https://github.com/wekan/wekan/issues/1863
+ // Swimlane added a new field in the cards collection of mongodb named parentId.
+ // When loading a board, mongodb is searching for every cards, the id of the parent (in the swinglanes collection).
+ // With a huge database, this result in a very slow app and high CPU on the mongodb side.
+ // To correct it, add Index to parentId:
+ Cards._collection._ensureIndex({"parentId": 1});
});
Cards.after.insert((userId, doc) => {