kocolosk opened a new pull request #1377: Fix _approx_count_distinct on non-clustered interface, optimize _stats URL: https://github.com/apache/couchdb/pull/1377 ## Overview One bugfix and one enhancement here. The bugfix is that the `finalize` operation introduced for `_approx_count_distinct` was not being executed on view requests coming in through the non-clustered interface, so any attempt to use that reduce function there would crash. The enhancement is to take advantage of that `finalize` operation to optimize the builtin `_stats` reduce function. Previously the reduce function would always write down an ejson form for the 5 statistical quantities to disk as it could never know whether the `rereduce` function was being called during indexing or during querying. Now that we have the `finalize` operation (which only runs at query time) we can store a more compact format on disk and avoid continuously translating back and forth between the compact and ejson formats during indexing. This should result in slightly more efficient builds and slightly smaller resulting indexes. ## Testing recommendations Run the _stats tests against clustered and non-clustered interfaces. ## Checklist - [x] Code is written and works correctly; - [x] Changes are covered by tests; - [x] Documentation reflects the changes;
---------------------------------------------------------------- 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
