chewbranca commented on code in PR #4990:
URL: https://github.com/apache/couchdb/pull/4990#discussion_r1511971244


##########
src/mango/src/mango_cursor_text.erl:
##########
@@ -109,7 +110,7 @@ execute(Cursor, UserFun, UserAcc) ->
         user_fun = UserFun,
         user_acc = UserAcc,
         fields = Cursor#cursor.fields,
-        execution_stats = mango_execution_stats:log_start(Stats),
+        execution_stats = mango_execution_stats:log_start(Stats, DbName),

Review Comment:
   Yeah good call on moving this into the create logic, that seems better. The 
initialization of the `#execution_stats{}` record is a bit convoluted though in 
that it happens in `mango_cursor.hrl` here 
https://github.com/apache/couchdb/blob/4643fec27b2cd75a504c7c6356f60c0127acb4a5/src/mango/src/mango_cursor.hrl#L28
 and your patch actually creates a brand new version of the 
`#execution_stats{}` record, dumping the original one.
   
   I've taken your suggestion of moving this logic into the create calls, and 
I've also reworked the `#execution_stats{}` initialization logic to be 
postponed until the create function as well, along with utilize a dedicated 
initializer function in ~517fce8b6~. (whoops, accidentally re-added khash in 
that commit, updated commit here, hopefully this didn't screw with the history 
too much, I only unwound and force pushed the last commit to 22781e1a1).



-- 
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]

Reply via email to