title: Parse-Server source _rperm and _wperm mongo queries, and should I index them?
body: <p>I'm going through my mongo logs to add indexes for my unindexed queries. By default, mongo only logs queries that take over 100ms to complete.</p>
  
  <p>I've found that I have several on _wperm and _rperm keys. I see that is how the ACL gets broken down. But what type of Parse.Query call might create a query like this in the logs?</p>
  
  <p><code>query: { orderby: {}, $query: { _rperm: { $in: [ null, "*", "[UserId]" ] } } }</code></p>
  
  <p>I'm even noticing that this query is on a class that has only 8 total objects, yet is taking 133ms to complete, which seems really slow for such a small class, even if it had to do an in memory sort and scan. </p>
  
  <p>Should I solve this at the code level, modifying my query to avoid this type of mongo query? Or should I add an index for these types of queries? </p>
  
  <p>I notice I also have a few that are showing up in the Slow Queries tab on mLab.  The query looks like <code>{"_id":"&lt;val&gt;","_wperm":{"$in":["&lt;vals&gt;"]}}</code>, with the suggested index <code>{"_id": 1, "_wperm": 1}</code>, but it has the following note:</p>
  
  <blockquote>
    <p>"_id" is in the existing {"_id": 1} unique index. The following index recommendation should only be necessary in certain circumstances.</p>
  </blockquote>
  
  <p>Yet, this is one of my slower queries, taking 320 ms to complete. It's on the _User class. Is that just because the _User class has a lot of rows? Since the _id is unique I feel like it shouldn't really make a difference adding a _wperm index, since I end up with only a single object.</p>
  
  <p>I'm curious if I will see a benefit from taking action on these queries or if I should safely ignore them.</p>