   Messages._ensureIndex [
     ['group', 1]
     ['updated', -1]
+  ]
+  ## This index makes findMessageParent fast.
+  Messages._ensureIndex [
+    ['children', 1]
   ]
 
 @rootMessages = (group) ->

          $set: root: root ? child
        ,
          multi: true
    else
      ## To reparent root message, change the root of all descendants.
      Messages.update
        root: child
      ,

      $set: root: root
    if cmsg.root?
      ## If we move a nonroot message to have new root, update descendants.
      descendants = descendantMessageIds cmsg
      if descendants.length > 0
        Messages.update
          _id: $in: descendants
