horaedb icon indicating copy to clipboard operation
horaedb copied to clipboard

Avoid unnecessary merge

Open ShiKaiWi opened this issue 2 years ago • 0 comments

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

ShiKaiWi avatar Jun 19 '23 03:06 ShiKaiWi