github.com/cockroachdb/pebble@v0.0.0-20231214172447-ab4952c5f87b/internal/rangekey/testdata/coalesce (about) 1 # All disjoint RANGEKEYSETs. 2 3 coalesce 4 a-c:{(#10,RANGEKEYSET,@5,foo)} 5 ---- 6 a-c:{(#10,RANGEKEYSET,@5,foo)} 7 8 coalesce 9 c-d:{(#4,RANGEKEYSET,@3,foo)} 10 ---- 11 c-d:{(#4,RANGEKEYSET,@3,foo)} 12 13 coalesce 14 e-f:{(#20,RANGEKEYSET,@5,bar) (#20,RANGEKEYSET,@3,foo)} 15 ---- 16 e-f:{(#20,RANGEKEYSET,@5,bar) (#20,RANGEKEYSET,@3,foo)} 17 18 # Merge overlapping RANGEKEYSETs. 19 20 coalesce 21 a-c:{(#10,RANGEKEYSET,@5,foo5) (#4,RANGEKEYSET,@3,foo3) (#4,RANGEKEYSET,@2,foo2)} 22 ---- 23 a-c:{(#10,RANGEKEYSET,@5,foo5) (#4,RANGEKEYSET,@3,foo3) (#4,RANGEKEYSET,@2,foo2)} 24 25 # RANGEKEYUNSETs. 26 27 coalesce 28 a-c:{(#10,RANGEKEYUNSET,@5)} 29 ---- 30 a-c:{(#10,RANGEKEYUNSET,@5)} 31 32 coalesce 33 c-d:{(#4,RANGEKEYUNSET,@3)} 34 ---- 35 c-d:{(#4,RANGEKEYUNSET,@3)} 36 37 coalesce 38 e-f:{(#20,RANGEKEYUNSET,@5) (#20,RANGEKEYUNSET,@3)} 39 ---- 40 e-f:{(#20,RANGEKEYUNSET,@5) (#20,RANGEKEYUNSET,@3)} 41 42 # Merge overlapping RANGEKEYUNSETs. 43 44 coalesce 45 a-c:{(#10,RANGEKEYUNSET,@5) (#4,RANGEKEYUNSET,@3) (#4,RANGEKEYUNSET,@2)} 46 ---- 47 a-c:{(#10,RANGEKEYUNSET,@5) (#4,RANGEKEYUNSET,@3) (#4,RANGEKEYUNSET,@2)} 48 49 # Unsets may partially remove sets. 50 51 coalesce 52 a-c:{(#10,RANGEKEYUNSET,@100) (#9,RANGEKEYSET,@100,v100) (#9,RANGEKEYSET,@50,v50)} 53 ---- 54 a-c:{(#10,RANGEKEYUNSET,@100) (#9,RANGEKEYSET,@50,v50)} 55 56 coalesce 57 c-d:{(#9,RANGEKEYSET,@100,v100) (#9,RANGEKEYSET,@50,v50)} 58 ---- 59 c-d:{(#9,RANGEKEYSET,@100,v100) (#9,RANGEKEYSET,@50,v50)} 60 61 # Unsets may wholly remove sets. 62 63 coalesce 64 b-c:{(#10,RANGEKEYUNSET,@3) (#10,RANGEKEYUNSET,@2) (#10,RANGEKEYUNSET,@1) (#8,RANGEKEYSET,@3,v3) (#8,RANGEKEYSET,@2,v2) (#8,RANGEKEYSET,@1,v1)} 65 ---- 66 b-c:{(#10,RANGEKEYUNSET,@3) (#10,RANGEKEYUNSET,@2) (#10,RANGEKEYUNSET,@1)} 67 68 # Sets may shadow unsets. 69 70 coalesce 71 a-c:{(#5,RANGEKEYSET,@5,v5) (#4,RANGEKEYUNSET,@5)} 72 ---- 73 a-c:{(#5,RANGEKEYSET,@5,v5)} 74 75 # Deletes shadow Sets and Unsets, but not at the same sequence number. 76 77 coalesce 78 a-c:{(#10,RANGEKEYSET,@5,foo5) (#10,RANGEKEYDEL) (#8,RANGEKEYUNSET,@1) (#4,RANGEKEYSET,@3,foo3) (#4,RANGEKEYSET,@2,foo2)} 79 ---- 80 a-c:{(#10,RANGEKEYSET,@5,foo5) (#10,RANGEKEYDEL)} 81 82 # Within a sequence number, none of the internal range keys affect one another. 83 84 coalesce 85 a-c:{(#5,RANGEKEYSET,@5,foo) (#5,RANGEKEYUNSET,@5) (#5,RANGEKEYDEL)} 86 ---- 87 a-c:{(#5,RANGEKEYSET,@5,foo) (#5,RANGEKEYDEL)}