Novu Subscribers page Mongo query issue

Hi Team,
I noticed something weird with the new subscriber page.
The mongo-db query seems to be really taxing on the DB. Here's the specific query I am talking about. Also, I provided a screenshot of the mongo-db profiler showing the query's effects on the system. It seems to be caused by the query aggregate. Is there anything I could do to fix this? 🙂

{
  "type": "command",
  "ns": "novu.subscribers",
  "command": {
    "aggregate": "subscribers",
    "pipeline": [
      {
        "$match": {
          "_environmentId": {
            "$oid": "6321c40853b9b0393a2aad1a"
          },
          "_organizationId": {
            "$oid": "6321d40853b9b0393a2qrd37"
          },
          "deleted": {
            "$ne": true
          }
        }
      },
      {
        "$group": {
          "_id": 1,
          "n": {
            "$sum": 1
          }
        }
      }
    ],
    "cursor": {},
    "lsid": {
      "id": {
        "$binary": {
          "base64": "d/O/KdfFThyKUBvSirRXgg==",
          "subType": "04"
        }
      }
    },
    "$clusterTime": {
      "clusterTime": {
        "$timestamp": {
          "t": 1668789992,
          "i": 3
        }
      },
      "signature": {
        "hash": {
          "$binary": {
            "base64": "VVGRGY32MViHcN3qx/qV6BzR35E=",
            "subType": "00"
          }
        },
        "keyId": 7130339138124906000
      }
    },
    "$db": "novu"
  },
  "planSummary": "IXSCAN { _environmentId: 1, subscriberId: 1 }",
  "keysExamined": 31128975,
  "docsExamined": 31128975,
  "cursorExhausted": true,
  "numYields": 49837,
  "nreturned": 1,
  "queryHash": "D53F1F27",
  "planCacheKey": "CA47FC65",
  "queryExecutionEngine": "classic",
  "reslen": 254,
  "locks": {
    "FeatureCompatibilityVersion": {
      "acquireCount": {
        "r": 49839
      }
    },
    "Global": {
      "acquireCount": {
        "r": 49839
      }
    },
    "Mutex": {
      "acquireCount": {
        "r": 2
      }
    }
  },
  "readConcern": {
    "level": "local",
    "provenance": "implicitDefault"
  },
  "writeConcern": {
    "w": "majority",
    "wtimeout": 0,
    "provenance": "implicitDefault"
  },
  "storage": {
    "data": {
      "bytesRead": 226315209471,
      "timeReadingMicros": 62534574
    },
    "timeWaitingMicros": {
      "cache": 54886
    }
  },
  "remote": "X.X.X.X:XXXX",
  "protocol": "op_msg",
  "durationMillis": 976902,
  "v": "6.0.2"
}
unknown.png
Was this page helpful?