In trying to understand how Parse indexes work with Mongo, I noticed that some of my slow queries were using the _rperm
field (from the ACL) even though I didn't specify it in the indexes that I defined. It isn't on every query either so I'm wondering why some queries need _rperm
indexed and some don't.
If I query by just the id, the index seems to require
{"_id": 1, "_rperm": 1}
and not just the {"_id": 1}
index that is already defined.
What does parse do in the background to add _rperm
and when do I need to include it as an index?
The reason for the inconsistent use of the _rperm
index is due to the use of useMasterKey in the cloud code.
If you use the master key with the query then it won't require to check the ACL. But, if you don't use master key in your query, you will need to index the _rperm
field on your collections in order for that query to run efficiently.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With