horaedb
horaedb copied to clipboard
Avoid unnecessary merge
Describe This Problem
Currently, merge sort is applied over all the ssts in one specific segment, in order for following dedup procedure. However, what is required by dedup is much less than the global order of all the rows of all the ssts, that is to say, current merge sort is unecessary.
Proposal
What we need for dedup is just to gather all the rows sharing the same primary key in the order of their sequence number. And that is to say, there is no need to do merge sort over the ssts whose key range don't overlap between each other.
Additional Context
No response