github.com/cockroachdb/pebble@v1.1.2/sstable/testdata/block_properties_boundlimited (about)

     1  build block-size=28 collectors=(suffix)
     2  a@5.SET.1:15
     3  b@2.SET.2:86
     4  c@9.SET.3:72
     5  d@3.SET.4:21
     6  e@2.SET.5:47
     7  f@0.SET.6:54
     8  g@8.SET.7:63
     9  h@3.SET.8:38
    10  ----
    11  point:    [a@5#1,1,h@3#8,1]
    12  rangedel: [#0,0,#0,0]
    13  rangekey: [#0,0,#0,0]
    14  seqnums:  [1,8]
    15  
    16  collectors
    17  ----
    18  0: suffix
    19  
    20  table-props
    21  ----
    22  0: [0, 10)
    23  
    24  block-props
    25  ----
    26  c#72057594037927935,17:
    27    0: [2, 6)
    28  e#72057594037927935,17:
    29    0: [3, 10)
    30  g#72057594037927935,17:
    31    0: [0, 3)
    32  i#72057594037927935,17:
    33    0: [3, 9)
    34  
    35  # Test an interator with a bound-limited filter that has a filtering criteria
    36  # too narrow to exclude any blocks.
    37  
    38  iter filter=(suffix,1,20)
    39  first
    40  next
    41  next
    42  next
    43  next
    44  next
    45  next
    46  next
    47  next
    48  ----
    49      filter.Intersects([2, 6)) = (true, <nil>)
    50  <a@5:1> MaybeFilteredKeys()=false
    51  <b@2:2> MaybeFilteredKeys()=false
    52      filter.Intersects([3, 10)) = (true, <nil>)
    53  <c@9:3> MaybeFilteredKeys()=false
    54  <d@3:4> MaybeFilteredKeys()=false
    55      filter.Intersects([0, 3)) = (true, <nil>)
    56  <e@2:5> MaybeFilteredKeys()=false
    57  <f@0:6> MaybeFilteredKeys()=false
    58      filter.Intersects([3, 9)) = (true, <nil>)
    59  <g@8:7> MaybeFilteredKeys()=false
    60  <h@3:8> MaybeFilteredKeys()=false
    61  . MaybeFilteredKeys()=false
    62  
    63  # Test an interator with a bound-limited filter that excludes one block, the
    64  # third block.
    65  
    66  iter filter=(suffix,3,20)
    67  first
    68  next
    69  next
    70  next
    71  next
    72  next
    73  next
    74  ----
    75      filter.Intersects([2, 6)) = (true, <nil>)
    76  <a@5:1> MaybeFilteredKeys()=false
    77  <b@2:2> MaybeFilteredKeys()=false
    78      filter.Intersects([3, 10)) = (true, <nil>)
    79  <c@9:3> MaybeFilteredKeys()=false
    80  <d@3:4> MaybeFilteredKeys()=false
    81      filter.Intersects([0, 3)) = (false, <nil>)
    82      filter.KeyIsWithinUpperBound(g) = true
    83      filter.Intersects([3, 9)) = (true, <nil>)
    84  <g@8:7> MaybeFilteredKeys()=true
    85  <h@3:8> MaybeFilteredKeys()=false
    86  . MaybeFilteredKeys()=false
    87  
    88  # Test the same case but with an upper bound set that prevents skipping the
    89  # block.
    90  
    91  iter filter=(suffix,3,20) filter-upper=f@9
    92  first
    93  next
    94  next
    95  next
    96  next
    97  next
    98  next
    99  next
   100  next
   101  ----
   102      filter.Intersects([2, 6)) = (true, <nil>)
   103  <a@5:1> MaybeFilteredKeys()=false
   104  <b@2:2> MaybeFilteredKeys()=false
   105      filter.Intersects([3, 10)) = (true, <nil>)
   106  <c@9:3> MaybeFilteredKeys()=false
   107  <d@3:4> MaybeFilteredKeys()=false
   108      filter.Intersects([0, 3)) = (false, <nil>)
   109      filter.KeyIsWithinUpperBound(g) = false
   110  <e@2:5> MaybeFilteredKeys()=false
   111  <f@0:6> MaybeFilteredKeys()=false
   112      filter.Intersects([3, 9)) = (true, <nil>)
   113  <g@8:7> MaybeFilteredKeys()=false
   114  <h@3:8> MaybeFilteredKeys()=false
   115  . MaybeFilteredKeys()=false
   116  
   117  # Test a case that filters the first two blocks. The third block is not filtered
   118  # due to block-property intersection. The fourth block is not filtered due to
   119  # the upper bound.
   120  
   121  iter filter=(suffix,0,1) filter-upper=h@6
   122  first
   123  next
   124  next
   125  next
   126  next
   127  ----
   128      filter.Intersects([2, 6)) = (false, <nil>)
   129      filter.KeyIsWithinUpperBound(c) = true
   130      filter.Intersects([3, 10)) = (false, <nil>)
   131      filter.KeyIsWithinUpperBound(e) = true
   132      filter.Intersects([0, 3)) = (true, <nil>)
   133  <e@2:5> MaybeFilteredKeys()=true
   134  <f@0:6> MaybeFilteredKeys()=false
   135      filter.Intersects([3, 9)) = (false, <nil>)
   136      filter.KeyIsWithinUpperBound(i) = false
   137  <g@8:7> MaybeFilteredKeys()=false
   138  <h@3:8> MaybeFilteredKeys()=false
   139  . MaybeFilteredKeys()=false
   140  
   141  # Test a similar case in reverse. In reverse if the very first block is reached,
   142  # we do not know whether or not it's actually within the bounds because we don't
   143  # have another index separator to bound the block. As such, there's no call to
   144  # KeyIsWithinLowerBound for the first block of the sstable [ie, the last one
   145  # visited by the iterator].
   146  
   147  iter filter=(suffix,9,10) filter-lower=a@0
   148  last
   149  prev
   150  prev
   151  prev
   152  prev
   153  ----
   154      filter.Intersects([3, 9)) = (false, <nil>)
   155      filter.KeyIsWithinLowerBound(g) = true
   156      filter.Intersects([0, 3)) = (false, <nil>)
   157      filter.KeyIsWithinLowerBound(e) = true
   158      filter.Intersects([3, 10)) = (true, <nil>)
   159  <d@3:4> MaybeFilteredKeys()=true
   160  <c@9:3> MaybeFilteredKeys()=false
   161      filter.Intersects([2, 6)) = (false, <nil>)
   162  <b@2:2> MaybeFilteredKeys()=false
   163  <a@5:1> MaybeFilteredKeys()=false
   164  . MaybeFilteredKeys()=false
   165  
   166  # Add tests with other non-limited filters set, including one with the same
   167  # Name.