From 9746508dabc41216194d745e17d3a665a3c43130 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Sun, 18 Aug 2019 10:53:52 +0200 Subject: [PATCH] New indexes for replies --- core/indexes.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/indexes.py b/core/indexes.py index 7cd8865..a78ba02 100644 --- a/core/indexes.py +++ b/core/indexes.py @@ -83,3 +83,13 @@ def create_indexes(): # For the is_actor_icon_cached query MEDIA_CACHE.fs._GridFS__files.create_index([("url", 1), ("kind", 1)]) + + # Replies index + DB.replies.create_index([("remote_id", pymongo.ASCENDING)]) + DB.replies.create_index([("meta.thread_root_parent", pymongo.ASCENDING)]) + DB.replies.create_index( + [ + ("meta.thread_root_parent", pymongo.ASCENDING), + ("meta.deleted", pymongo.ASCENDING), + ] + )