If I visit MongoDB Atlas Profiler, I can observe on each and every day a similar pattern of slow queries. It looks like this:
If ordered by Mean or Sum of operation execution time, the top 30 or more are collections with suffix _gtins_catalog
that are empty, created when the user is creating an account.
Now, when I am investigating the queries for any of these collections they are usually several of them
and all of them have pipeline like this:
"originatingCommand": {
"aggregate": "241e8df1-c055-424b-9e37-37012aa61f4e_gtins_catalog",
"cursor": {
"batchSize": 0
},
"pipeline": [
{
"$changeStream": {
"startAfter": {
"_data": "826470CC57000000012B0229296E04"
},
"fullDocument": "updateLookup",
"showMigrationEvents": true
}
}
],
"$db": "prod_sm",
...
}
And the Operation Execution Time can even reach up to 2 min.
And now is my question. I can’t figure out what cause this pipelines to be executed, especially on empty collections, and why they are this slow. Is this some internal operations that Mongo have to perform?
It would be very helpful If someone could cast a bit of light on this.