nickva commented on a change in pull request #541: Allow configuration of max 
doc IDs for optimised code path in changes filter
URL: https://github.com/apache/couchdb/pull/541#discussion_r119991472
 
 

 ##########
 File path: src/couch/src/couch_changes.erl
 ##########
 @@ -556,9 +552,15 @@ send_changes(Acc, Dir, FirstRound) ->
     end.
 
 
-can_optimize(true, {doc_ids, _Style, DocIds})
-        when length(DocIds) =< ?MAX_DOC_IDS ->
-    {true, fun send_changes_doc_ids/6};
+can_optimize(true, {doc_ids, _Style, DocIds}) ->
+    MaxDocIds = list_to_integer(
+        config:get("changes", "max_doc_ids", "100")
 
 Review comment:
   Thanks for PR.
   
   A few suggestions:
   
   * Instead of `max_doc_ids` maybe make it a bit more descriptive, something 
like `doc_ids_optimization_threshold`
   
    * Consider using `config:get_integer` as in:
   ```
    MaxDocIds = config:get_integer("changes", "max_doc_ids", 100) 
   ```
    * Make sure to add the section with the default value and a description to 
the default.ini config file. It's in : `rel/overlay/etc/default.ini`
    
     * We don't have an existing `[changes]` section, wonder if it would be 
better to add this to `[couchdb]`. I am 50/50 on this, let's see what others 
think.
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to