You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/03/13 23:49:29 UTC

[GitHub] [couchdb] oliverdain edited a comment on issue #2124: Mango: do not warn about missing index when only _id is being selected against

oliverdain edited a comment on issue #2124: Mango: do not warn about missing index when only _id is being selected against
URL: https://github.com/apache/couchdb/issues/2124#issuecomment-598975215
 
 
   Hi @wohali . Thanks for the explanation. I've simplified the real query here to make the bug report simpler but the real query used `_id` *and* some other fields to further limit the results I get. Note that with Mango this is legal and if I do that with an index other than `_all_docs` I do not get a warning. For example, a query like this is, I think, quite reasonable:
   
   ```
   {
      "selector": {
         "$and": [
            {
               "_id": {
                  "$gt": "bar"
               }
            },
            {
               "_id": {
                  "$lt": "foo"
               }
            },
           {
             "other_field": "some value"
           }
         ]
      }
   }
   ```
   
   Assuming there aren't too many docs with `_id` between `bar` and `foo` this is a very useful way to use Mango and the performance is quite good.
   
   I think the desired behavior isn't "suppress the warning when **only** the _id field is being used" but rather something like "suppress the warning when the _id field has significantly reduced the set of documents that must be examined" or whatever the equivalent rule is for a normal Mango index.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services