pgj opened a new pull request, #4792: URL: https://github.com/apache/couchdb/pull/4792
*This is an alternative to #4710 based on the results of the related discussion.* It is not always beneficial for the performance if the Mango query planner tries to assign an index to the selector. User-specified indexes may save the day, but since they are only hints for the planner, fallbacks may still happen. Introduce the `allow_fallback` flag which can be used to tell if falling back to other indexes is acceptable when an index is explicitly specified by the user. When set to `false`, give up on planning and return an HTTP 400 response right away. This way the user has the chance to learn about the requested but missing index, optionally create it and try again. By default, fallbacks are allowed to maintain backwards compatibility. It is possible to set `allow_fallback` to `true` but currently it coincides with the default behavior hence becomes a no-op in practice. Fixes #4511 ## Testing recommendations The changes could be verified by the following commands: ```shell make eunit apps=mango make mango-test ``` This is a non-breaking change, so there should be no observable difference in the behavior for the users. When `allow_fallback` is set to `false` and `use_index` is set to some index, it may return HTTP 400 depending on the suitability of the given index. ## Checklist - [x] Code is written and works correctly - [x] Changes are covered by tests - [x] Documentation changes were made in the `src/docs` folder -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
