Closed AskAlexSharov closed 3 years ago
To avoid this the search-and-compare should be performed for each update operation. This is easy, but it will cost additional CPU cycles, and most importantly, such conditions (i.e. updates with the same data) is a fairly rare scenario. Therefore, when updating data, such a check is not done in the main execution path.
I don't think that I should improve anything, because the required behavior is easily implemented by a combination of mdbx_cursor_get()
and mdbx_cursor_put(..., MDBX_CURRENT)
.
right
If put key/value pair which 100% match current in db - then update doesn't change anything (in terms of data), but mark page as dirty. So, it's possible to create large transaction which doesn't change any key/value pair.
It's not a big deal to check before update on APP side, just: 1. I'm not sure if it's bug/feature/performance tradeoff 2. I didn't know about this detail - but it looks important potential optimization of commit speed - then maybe need mention it in docs.