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

     1  define
     2  a.SET.1:1 b.SET.2:2
     3  c.SET.3:3 d.SET.4:4
     4  dd.SET.5:5
     5  ----
     6  
     7  iter
     8  seek-ge a
     9  next
    10  next
    11  next
    12  next
    13  next
    14  ----
    15  a#1,1:1
    16  b#2,1:2
    17  c#3,1:3
    18  d#4,1:4
    19  dd#5,1:5
    20  .
    21  
    22  iter
    23  seek-ge b
    24  next
    25  next
    26  next
    27  next
    28  ----
    29  b#2,1:2
    30  c#3,1:3
    31  d#4,1:4
    32  dd#5,1:5
    33  .
    34  
    35  iter
    36  seek-ge c
    37  next
    38  next
    39  next
    40  ----
    41  c#3,1:3
    42  d#4,1:4
    43  dd#5,1:5
    44  .
    45  
    46  iter
    47  seek-ge d
    48  next
    49  next
    50  ----
    51  d#4,1:4
    52  dd#5,1:5
    53  .
    54  
    55  iter
    56  seek-ge dd
    57  next
    58  ----
    59  dd#5,1:5
    60  .
    61  
    62  iter
    63  seek-ge e
    64  ----
    65  .
    66  
    67  iter
    68  seek-lt a
    69  ----
    70  .
    71  
    72  iter
    73  seek-lt b
    74  prev
    75  ----
    76  a#1,1:1
    77  .
    78  
    79  iter
    80  seek-lt c
    81  prev
    82  prev
    83  ----
    84  b#2,1:2
    85  a#1,1:1
    86  .
    87  
    88  iter
    89  seek-lt d
    90  prev
    91  prev
    92  prev
    93  ----
    94  c#3,1:3
    95  b#2,1:2
    96  a#1,1:1
    97  .
    98  
    99  iter
   100  seek-lt e
   101  prev
   102  prev
   103  prev
   104  prev
   105  prev
   106  ----
   107  dd#5,1:5
   108  d#4,1:4
   109  c#3,1:3
   110  b#2,1:2
   111  a#1,1:1
   112  .
   113  
   114  iter
   115  seek-prefix-ge a
   116  next
   117  ----
   118  a#1,1:1
   119  b#2,1:2
   120  
   121  iter
   122  seek-prefix-ge d
   123  next
   124  next
   125  ----
   126  d#4,1:4
   127  dd#5,1:5
   128  .
   129  
   130  iter
   131  seek-prefix-ge dd
   132  next
   133  ----
   134  dd#5,1:5
   135  .
   136  
   137  iter
   138  seek-prefix-ge d
   139  next
   140  prev
   141  prev
   142  ----
   143  d#4,1:4
   144  dd#5,1:5
   145  d#4,1:4
   146  c#3,1:3
   147  
   148  iter
   149  seek-prefix-ge d
   150  prev
   151  ----
   152  d#4,1:4
   153  c#3,1:3
   154  
   155  iter
   156  seek-prefix-ge dd
   157  prev
   158  ----
   159  dd#5,1:5
   160  d#4,1:4
   161  
   162  iter lower=a
   163  seek-ge a
   164  first
   165  ----
   166  a#1,1:1
   167  a#1,1:1
   168  
   169  iter
   170  set-bounds lower=a
   171  seek-ge a
   172  first
   173  ----
   174  a#1,1:1
   175  a#1,1:1
   176  
   177  iter
   178  set-bounds lower=dd upper=f
   179  seek-lt dc
   180  set-bounds lower=a upper=f
   181  seek-lt dc
   182  prev
   183  prev
   184  prev
   185  prev
   186  ----
   187  .
   188  d#4,1:4
   189  c#3,1:3
   190  b#2,1:2
   191  a#1,1:1
   192  .
   193  
   194  iter
   195  set-bounds lower=a upper=b
   196  seek-ge c
   197  set-bounds lower=a upper=f
   198  seek-ge c
   199  next
   200  next
   201  next
   202  ----
   203  .
   204  c#3,1:3
   205  d#4,1:4
   206  dd#5,1:5
   207  .
   208  
   209  # levelIter trims lower/upper bound in the options passed to sstables.
   210  load a
   211  ----
   212  [,]
   213  
   214  load b lower=aa upper=bb
   215  ----
   216  [aa,]
   217  
   218  load b lower=aa upper=c
   219  ----
   220  [aa,]
   221  
   222  load c lower=b upper=d
   223  ----
   224  [,d]
   225  
   226  load c lower=b upper=e
   227  ----
   228  [,]
   229  
   230  # levelIter only checks lower bound when loading sstables.
   231  iter lower=b
   232  seek-ge a
   233  first
   234  ----
   235  a#1,1:1
   236  a#1,1:1
   237  
   238  iter lower=c
   239  seek-ge a
   240  first
   241  ----
   242  c#3,1:3
   243  c#3,1:3
   244  
   245  iter
   246  set-bounds lower=b
   247  seek-ge a
   248  first
   249  ----
   250  a#1,1:1
   251  a#1,1:1
   252  
   253  iter
   254  set-bounds lower=c
   255  seek-ge a
   256  first
   257  ----
   258  c#3,1:3
   259  c#3,1:3
   260  
   261  # levelIter only checks lower bound when loading sstables.
   262  iter lower=d
   263  seek-ge a
   264  first
   265  ----
   266  c#3,1:3
   267  c#3,1:3
   268  
   269  iter lower=e
   270  seek-ge a
   271  first
   272  ----
   273  .
   274  .
   275  
   276  iter upper=e
   277  seek-lt e
   278  last
   279  ----
   280  dd#5,1:5
   281  dd#5,1:5
   282  
   283  iter
   284  set-bounds lower=d
   285  seek-ge a
   286  first
   287  ----
   288  c#3,1:3
   289  c#3,1:3
   290  
   291  iter
   292  set-bounds lower=e
   293  seek-ge a
   294  first
   295  ----
   296  .
   297  .
   298  
   299  iter
   300  set-bounds upper=e
   301  seek-lt e
   302  last
   303  ----
   304  dd#5,1:5
   305  dd#5,1:5
   306  
   307  # levelIter only checks upper bound when loading sstables.
   308  iter upper=d
   309  seek-lt e
   310  last
   311  ----
   312  d#4,1:4
   313  d#4,1:4
   314  
   315  iter upper=c
   316  seek-lt e
   317  last
   318  ----
   319  b#2,1:2
   320  b#2,1:2
   321  
   322  iter
   323  set-bounds upper=d
   324  seek-lt e
   325  last
   326  ----
   327  d#4,1:4
   328  d#4,1:4
   329  
   330  iter
   331  set-bounds upper=c
   332  seek-lt e
   333  last
   334  ----
   335  b#2,1:2
   336  b#2,1:2
   337  
   338  # levelIter only checks upper bound when loading sstables.
   339  iter upper=b
   340  seek-lt e
   341  last
   342  ----
   343  b#2,1:2
   344  b#2,1:2
   345  
   346  iter upper=a
   347  seek-lt e
   348  last
   349  ----
   350  .
   351  .
   352  
   353  iter upper=dd
   354  seek-prefix-ge d
   355  next
   356  ----
   357  d#4,1:4
   358  .
   359  
   360  iter
   361  set-bounds upper=b
   362  seek-lt e
   363  last
   364  ----
   365  b#2,1:2
   366  b#2,1:2
   367  
   368  iter
   369  set-bounds upper=a
   370  seek-lt e
   371  last
   372  ----
   373  .
   374  .
   375  
   376  iter
   377  set-bounds upper=dd
   378  seek-prefix-ge d
   379  next
   380  ----
   381  d#4,1:4
   382  .
   383  
   384  iter upper=e
   385  seek-prefix-ge d
   386  next
   387  next
   388  ----
   389  d#4,1:4
   390  dd#5,1:5
   391  .
   392  
   393  iter lower=dd
   394  seek-prefix-ge d
   395  next
   396  ----
   397  dd#5,1:5
   398  .
   399  
   400  iter lower=d
   401  seek-prefix-ge dd
   402  prev
   403  ----
   404  dd#5,1:5
   405  d#4,1:4
   406  
   407  iter lower=c
   408  seek-prefix-ge dd
   409  prev
   410  ----
   411  dd#5,1:5
   412  d#4,1:4
   413  
   414  iter lower=c
   415  seek-lt c
   416  ----
   417  .
   418  
   419  iter
   420  seek-lt c
   421  set-bounds lower=c
   422  seek-lt c
   423  ----
   424  b#2,1:2
   425  .
   426  
   427  iter upper=c
   428  seek-ge c
   429  ----
   430  .
   431  
   432  iter
   433  seek-ge c
   434  set-bounds upper=c
   435  seek-ge c
   436  ----
   437  c#3,1:3
   438  .
   439  
   440  # The behavior of next/prev after set-bounds is undefined. We're just
   441  # asserting the current behavior.
   442  
   443  # The lower bound is beyond the current table's bounds.
   444  
   445  iter
   446  seek-ge c
   447  set-bounds lower=e
   448  next
   449  ----
   450  c#3,1:3
   451  .
   452  
   453  # The lower bound lies within the current table's bounds.
   454  
   455  iter
   456  seek-ge c
   457  set-bounds lower=d
   458  next
   459  ----
   460  c#3,1:3
   461  d#4,1:4
   462  
   463  # The upper bound is before the current table's bounds.
   464  
   465  iter
   466  seek-ge d
   467  set-bounds upper=c
   468  prev
   469  ----
   470  d#4,1:4
   471  .
   472  
   473  # The upper bound lies within the current table's bounds.
   474  
   475  iter
   476  seek-ge d
   477  set-bounds upper=cc
   478  prev
   479  ----
   480  d#4,1:4
   481  c#3,1:3
   482  
   483  # Setting bounds should update the table bounds, allowing a subsequent
   484  # seek-ge/seek-lt to see the boundary keys.
   485  
   486  iter
   487  seek-ge d
   488  set-bounds lower=cc
   489  seek-lt d
   490  ----
   491  d#4,1:4
   492  .
   493  
   494  iter
   495  seek-ge c
   496  set-bounds upper=cc
   497  seek-ge d
   498  ----
   499  c#3,1:3
   500  .