Haeinsa applies mutations of transaction to rows on commit phase. If transaction contains several mutations for certain row, Haeinsa applies mutations step by step with checkAndPut and checkAndDelete operation. We can optimize this step.
Let's assume that certain transaction should applies following mutations to certain row:
put(row, col1, value1)
put(row, col2, value2)
delete(row, col1)
put(row, col3, value3)
put(row, col4, value4)
delete(row, col3)
put(row, col5, value5)
Here is comparison of how Haeinsa works on current version and optimized version:
Series of operations above have the same result but TO-BE has small number of operations which means faster. I didn't mention deleteFamily operation on the example, but this should be consider too.
Note that this optimization is effective on complicate transaction. With this merging mutation algorithm, we can achieve faster execution of complicate transaction.
Haeinsa applies mutations of transaction to rows on commit phase. If transaction contains several mutations for certain row, Haeinsa applies mutations step by step with
checkAndPut
andcheckAndDelete
operation. We can optimize this step.Let's assume that certain transaction should applies following mutations to certain row:
Here is comparison of how Haeinsa works on current version and optimized version:
checkAndDelete(row, [col1])
checkAndPut(row, [{col3, value3}, {col4, value4}])
checkAndDelete(row, [col3])
checkAndPut(row, [{col5, value5}], {lock, newLock})
checkAndDelete(row, [col1, col3])
checkAndPut(row, [{col1, value4}, {col2, value5}, {lock, newLock}])
Series of operations above have the same result but TO-BE has small number of operations which means faster. I didn't mention
deleteFamily
operation on the example, but this should be consider too.Note that this optimization is effective on complicate transaction. With this merging mutation algorithm, we can achieve faster execution of complicate transaction.