github.com/cockroachdb/pebble@v0.0.0-20231214172447-ab4952c5f87b/testdata/batch_range_ops (about)

     1  define
     2  set a 1
     3  set b 2
     4  merge c 3
     5  del-range a c
     6  del d
     7  range-key-set b c @4 value
     8  ----
     9  
    10  scan
    11  ----
    12  a#12,1:1
    13  b#17,1:2
    14  c#22,2:3
    15  d#32,0:
    16  
    17  scan range-del
    18  ----
    19  a-c:{(#27,RANGEDEL)}
    20  
    21  scan range-key
    22  ----
    23  b-c:{(#35,RANGEKEYSET,@4,value)}
    24  
    25  clear
    26  ----
    27  
    28  define
    29  del-range a b
    30  del-range b c
    31  del-range a c
    32  del-range b d
    33  ----
    34  
    35  scan range-del
    36  ----
    37  a-b:{(#22,RANGEDEL) (#12,RANGEDEL)}
    38  b-c:{(#27,RANGEDEL) (#22,RANGEDEL) (#17,RANGEDEL)}
    39  c-d:{(#27,RANGEDEL)}
    40  
    41  clear
    42  ----
    43  
    44  define
    45  range-key-del a b
    46  range-key-del b c
    47  range-key-del a c
    48  range-key-del b d
    49  ----
    50  
    51  scan range-key
    52  ----
    53  a-b:{(#22,RANGEKEYDEL) (#12,RANGEKEYDEL)}
    54  b-c:{(#27,RANGEKEYDEL) (#22,RANGEKEYDEL) (#17,RANGEKEYDEL)}
    55  c-d:{(#27,RANGEKEYDEL)}
    56  
    57  clear
    58  ----
    59  
    60  define
    61  del-range a b
    62  ----
    63  
    64  scan range-del
    65  ----
    66  a-b:{(#12,RANGEDEL)}
    67  
    68  define
    69  del-range b c
    70  ----
    71  
    72  scan range-del
    73  ----
    74  a-b:{(#12,RANGEDEL)}
    75  b-c:{(#17,RANGEDEL)}
    76  
    77  define
    78  del-range a c
    79  ----
    80  
    81  scan range-del
    82  ----
    83  a-b:{(#22,RANGEDEL) (#12,RANGEDEL)}
    84  b-c:{(#22,RANGEDEL) (#17,RANGEDEL)}
    85  
    86  define
    87  del-range b d
    88  ----
    89  
    90  scan range-del
    91  ----
    92  a-b:{(#22,RANGEDEL) (#12,RANGEDEL)}
    93  b-c:{(#27,RANGEDEL) (#22,RANGEDEL) (#17,RANGEDEL)}
    94  c-d:{(#27,RANGEDEL)}
    95  
    96  # Verify that adding a range tombstone via Batch.Apply invalidates the
    97  # cached fragmented tombstones.
    98  
    99  clear
   100  ----
   101  
   102  define
   103  del-range a b
   104  ----
   105  
   106  scan range-del
   107  ----
   108  a-b:{(#12,RANGEDEL)}
   109  
   110  apply
   111  del-range c d
   112  ----
   113  
   114  scan range-del
   115  ----
   116  a-b:{(#12,RANGEDEL)}
   117  c-d:{(#17,RANGEDEL)}
   118  
   119  # Verify that adding a range key via Batch.Apply invalidates the
   120  # cached fragmented range keys.
   121  
   122  clear
   123  ----
   124  
   125  define
   126  range-key-set a c @2 v
   127  ----
   128  
   129  scan range-key
   130  ----
   131  a-c:{(#12,RANGEKEYSET,@2,v)}
   132  
   133  apply
   134  range-key-unset a b @2
   135  ----
   136  
   137  scan range-key
   138  ----
   139  a-b:{(#23,RANGEKEYUNSET,@2) (#12,RANGEKEYSET,@2,v)}
   140  b-c:{(#12,RANGEKEYSET,@2,v)}