From 6c4e213b72d7e6f1af4b2bf8a18a61da29a9b486 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Sun, 4 Aug 2019 18:55:29 +0200 Subject: [PATCH] Tweak indexes --- core/indexes.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/core/indexes.py b/core/indexes.py index f294cac..00c91fd 100644 --- a/core/indexes.py +++ b/core/indexes.py @@ -15,7 +15,8 @@ def create_indexes(): [(_meta(MetaKey.NOTIFICATION_UNREAD), pymongo.ASCENDING)] ) DB.activities.create_index([("remote_id", pymongo.ASCENDING)]) - DB.activities.create_index([("activity.object.id", pymongo.ASCENDING)]) + DB.activities.create_index([("meta.actor_id", pymongo.ASCENDING)]) + DB.activities.create_index([("meta.object_id", pymongo.ASCENDING)]) DB.activities.create_index([("meta.thread_root_parent", pymongo.ASCENDING)]) DB.activities.create_index( [ @@ -26,14 +27,9 @@ def create_indexes(): DB.activities.create_index( [("activity.object.id", pymongo.ASCENDING), ("meta.deleted", pymongo.ASCENDING)] ) - DB.cache2.create_index( - [ - ("path", pymongo.ASCENDING), - ("type", pymongo.ASCENDING), - ("arg", pymongo.ASCENDING), - ] + DB.activities.create_index( + [("meta.object_id", pymongo.ASCENDING), ("type", pymongo.ASCENDING)] ) - DB.cache2.create_index("date", expireAfterSeconds=3600 * 12) # Index for the block query DB.activities.create_index(