# Test a simple sequence of flushes and compactions where all values are
# separated.

define value-separation=(true, 1, 3, 0, 1.0)
----

batch
set a 1
set b 2
----

compact a-b
----
L6:
  000005:[a#10,SET-b#11,SET] seqnums:[10-11] points:[a#10,SET-b#11,SET] size:862 blobrefs:[(B000006: 2); depth:1]
Blob files:
  B000006 physical:{000006 size:[92 (92B)] vals:[2 (2B)]}

batch
set c 3
set d 4
----

compact c-d
----
L6:
  000005:[a#10,SET-b#11,SET] seqnums:[10-11] points:[a#10,SET-b#11,SET] size:862 blobrefs:[(B000006: 2); depth:1]
  000008:[c#12,SET-d#13,SET] seqnums:[12-13] points:[c#12,SET-d#13,SET] size:862 blobrefs:[(B000009: 2); depth:1]
Blob files:
  B000006 physical:{000006 size:[92 (92B)] vals:[2 (2B)]}
  B000009 physical:{000009 size:[92 (92B)] vals:[2 (2B)]}

batch
set b 5
set c 6
----

compact a-d
----
L6:
  000013:[a#0,SET-d#0,SET] seqnums:[0-0] points:[a#0,SET-d#0,SET] size:919 blobrefs:[(B000006: 1), (B000012: 2), (B000009: 1); depth:2]
Blob files:
  B000006 physical:{000006 size:[92 (92B)] vals:[2 (2B)]}
  B000009 physical:{000009 size:[92 (92B)] vals:[2 (2B)]}
  B000012 physical:{000012 size:[92 (92B)] vals:[2 (2B)]}

batch
del-range a e
----

compact a-d
----

# Set up a scenario where there's a L6 sstable with a blob reference depth of 3,
# and the value separation policy is configured to limit the blob reference
# depth to 3.

define verbose value-separation=(true, 3, 3, 0s, 1.0)
L6 blob-depth=3
  a.SET.0:a
  b.SET.0:blob{fileNum=100002 value=bar}
  f.SET.0:blob{fileNum=100003 value=foo}
  k.SET.0:k
  z.SET.0:blob{fileNum=100004 value=zoo}
----
L6:
  000004:[a#0,SET-z#0,SET] seqnums:[0-0] points:[a#0,SET-z#0,SET] size:921 blobrefs:[(B100002: 3), (B100003: 3), (B100004: 3); depth:3]
Blob files:
  B100002 physical:{100002 size:[92 (92B)] vals:[3 (3B)]}
  B100003 physical:{100003 size:[92 (92B)] vals:[3 (3B)]}
  B100004 physical:{100004 size:[92 (92B)] vals:[3 (3B)]}

batch
set d hello
set e world
----

# Flush should write flushed values to a new blob file.

flush
----
L0.0:
  000006:[d#10,SET-e#11,SET] seqnums:[10-11] points:[d#10,SET-e#11,SET] size:861 blobrefs:[(B000007: 10); depth:1]
L6:
  000004:[a#0,SET-z#0,SET] seqnums:[0-0] points:[a#0,SET-z#0,SET] size:921 blobrefs:[(B100002: 3), (B100003: 3), (B100004: 3); depth:3]
Blob files:
  B000007 physical:{000007 size:[100 (100B)] vals:[10 (10B)]}
  B100002 physical:{100002 size:[92 (92B)] vals:[3 (3B)]}
  B100003 physical:{100003 size:[92 (92B)] vals:[3 (3B)]}
  B100004 physical:{100004 size:[92 (92B)] vals:[3 (3B)]}

# Compacting these two sstables should result in writing the values to a new
# blob file and the removal of the no longer referenced blob files.

compact a-z
----
L6:
  000008:[a#0,SET-z#0,SET] seqnums:[0-0] points:[a#0,SET-z#0,SET] size:931 blobrefs:[(B000009: 19); depth:1]
Blob files:
  B000009 physical:{000009 size:[112 (112B)] vals:[19 (19B)]}

# Ensure we can read the separated values by iterating over the database.

iter
first
next
next
next
next
next
next
----
a: (a, .)
b: (bar, .)
d: (hello, .)
e: (world, .)
f: (foo, .)
k: (k, .)
z: (zoo, .)

metrics
----
      |                             |                |       |   ingested   |     moved    |    written   |       |    amp   |    val sep    |     multilevel
level | tables  size val-bl vtables | score  ff  cff |   in  | tables  size | tables  size | tables  size |  read |   r   w  | refsz  valblk |   top   in  read
------+-----------------------------+----------------+-------+--------------+--------------+--------------+-------+----------+---------------+------------------
    0 |     0     0B     0B       0 |    -    0    0 |   41B |     0     0B |     0     0B |     1   861B |    0B |   0 25.9 |    0B      0B |    0B    0B    0B
    1 |     0     0B     0B       0 |    -    0    0 |    0B |     0     0B |     1   861B |     0     0B |    0B |   0    0 |    0B      0B |    0B    0B    0B
    2 |     0     0B     0B       0 |    -    0    0 |    0B |     0     0B |     0     0B |     0     0B |    0B |   0    0 |    0B      0B |    0B    0B    0B
    3 |     0     0B     0B       0 |    -    0    0 |    0B |     0     0B |     1   861B |     0     0B |    0B |   0    0 |    0B      0B |    0B    0B    0B
    4 |     0     0B     0B       0 |    -    0    0 |    0B |     0     0B |     0     0B |     0     0B |    0B |   0    0 |    0B      0B |    0B    0B    0B
    5 |     0     0B     0B       0 |    -    0    0 |    0B |     0     0B |     1   861B |     0     0B |    0B |   0    0 |    0B      0B |    0B    0B    0B
    6 |     1   931B     0B       0 |    - 0.00 0.00 |  861B |     0     0B |     0     0B |     1   931B | 1.7KB |   1 1.21 |  112B      0B |    0B    0B    0B
total |     1   931B     0B       0 |    -    -    - |   41B |     0     0B |     3  2.5KB |     2  1.8KB | 1.7KB |   1 52.3 |  112B      0B |    0B    0B    0B
----------------------------------------------------------------------------------------------------------------------------------------------------------------
WAL: 1 files (0B)  in: 30B  written: 41B (37% overhead)
Flushes: 1
Compactions: 4  estimated debt: 0B  in progress: 0 (0B)  canceled: 0 (0B)  failed: 0  problem spans: 0
             default: 1  delete: 0  elision: 0  move: 3  read: 0  tombstone-density: 0  rewrite: 0  copy: 0  multi-level: 2  blob-file-rewrite:  0
MemTables: 1 (256KB)  zombie: 1 (256KB)
Zombie tables: 0 (0B, local: 0B)
Backing tables: 0 (0B)
Virtual tables: 0 (0B)
Local tables size: 931B
Compression types: snappy: 1
Table stats: all loaded
Block cache: 4 entries (1.6KB)  hit rate: 70.3%
File cache: 1 tables, 1 blobfiles (376B)  hit rate: 82.2%
Range key sets: 0  Tombstones: 0  Total missized tombstones encountered: 0
Snapshots: 0  earliest seq num: 0
Table iters: 0
Filter utility: 0.0%
Ingestions: 0  as flushable: 0 (0B in 0 tables)
Cgo memory usage: 0B  block cache: 0B (data: 0B, maps: 0B, entries: 0B)  memtables: 0B

# Set the minimum size for a separated value to 5.

define value-separation=(true, 5, 3, 0s, 1.0)
----

batch
set bar bar
set foo foo
set fuzz fuzz
set yaya yaya
----

# The flush should not write a blob file because none of the keys have a
# sufficiently long value to be separated.

flush
----
L0.0:
  000005:[bar#10,SET-yaya#13,SET] seqnums:[10-13] points:[bar#10,SET-yaya#13,SET] size:787

batch
set a a
set b b
set h hello
set w world
----

# This flush *should* write a blob file, containing 2 values: "hello" and
# "world" totalling 10 bytes of logical values.

flush
----
L0.1:
  000007:[a#14,SET-w#17,SET] seqnums:[14-17] points:[a#14,SET-w#17,SET] size:909 blobrefs:[(B000008: 10); depth:1]
L0.0:
  000005:[bar#10,SET-yaya#13,SET] seqnums:[10-13] points:[bar#10,SET-yaya#13,SET] size:787
Blob files:
  B000008 physical:{000008 size:[100 (100B)] vals:[10 (10B)]}

get
a
b
h
w
----
a:a
b:b
h:hello
w:world

# Configure the database to require keys in the range [a,m) to be in-place.

define required-in-place=(a,m) value-separation=(true,1,3,0s,1.0)
----

batch
set a apple
set b banana
set c coconut
set d dragonfruit
set m mango
----

# The flush should write two sst files, and only "mango" should be separated. This
# should be reflected in the 5-byte value bytes of the blob file and the table's
# blob reference value size.

flush
----
L0.0:
  000005:[a#10,SET-d#13,SET] seqnums:[10-13] points:[a#10,SET-d#13,SET] size:809
  000006:[m#14,SET-m#14,SET] seqnums:[14-14] points:[m#14,SET-m#14,SET] size:858 blobrefs:[(B000007: 5); depth:1]
Blob files:
  B000007 physical:{000007 size:[94 (94B)] vals:[5 (5B)]}

# Construct an initial state with two overlapping files in L0, both with blob
# references. Because these files overlap and are in separate sublevels, a
# compaction that preserves blob references should sum their depths.

define value-separation=(true,1,5,0s,1.0) l0-compaction-threshold=2
L0 blob-depth=1
  a.SET.9:a
  d.SET.9:blob{fileNum=100001 value=d}
L0 blob-depth=3
  a.SET.1:a
  b.SET.1:blob{fileNum=100002 value=bar}
  f.SET.1:blob{fileNum=100003 value=foo}
  k.SET.1:k
  z.SET.1:blob{fileNum=100004 value=zoo}
----
L0.1:
  000004:[a#9,SET-d#9,SET] seqnums:[9-9] points:[a#9,SET-d#9,SET] size:871 blobrefs:[(B100001: 1); depth:1]
L0.0:
  000005:[a#1,SET-z#1,SET] seqnums:[1-1] points:[a#1,SET-z#1,SET] size:921 blobrefs:[(B100002: 3), (B100003: 3), (B100004: 3); depth:3]
Blob files:
  B100001 physical:{100001 size:[90 (90B)] vals:[1 (1B)]}
  B100002 physical:{100002 size:[92 (92B)] vals:[3 (3B)]}
  B100003 physical:{100003 size:[92 (92B)] vals:[3 (3B)]}
  B100004 physical:{100004 size:[92 (92B)] vals:[3 (3B)]}

compact a-z
----
L1:
  000006:[a#0,SET-z#0,SET] seqnums:[0-0] points:[a#0,SET-z#0,SET] size:922 blobrefs:[(B100002: 3), (B100001: 1), (B100003: 3), (B100004: 3); depth:4]
Blob files:
  B100001 physical:{100001 size:[90 (90B)] vals:[1 (1B)]}
  B100002 physical:{100002 size:[92 (92B)] vals:[3 (3B)]}
  B100003 physical:{100003 size:[92 (92B)] vals:[3 (3B)]}
  B100004 physical:{100004 size:[92 (92B)] vals:[3 (3B)]}

# Construct an initial state with two non-overlapping files in L0, both with
# blob references. Because these files do NOT overlap and are in the same
# sublevel, a compaction that preserves blob references should take the MAX of
# their depths.

define value-separation=(true,1,5,0s,1.0) l0-compaction-threshold=2
L0 blob-depth=1
  a.SET.9:a
  d.SET.9:blob{fileNum=100001 value=d}
L0 blob-depth=3
  e.SET.1:a
  f.SET.1:blob{fileNum=100002 value=bar}
  g.SET.1:blob{fileNum=100003 value=foo}
  k.SET.1:k
  z.SET.1:blob{fileNum=100004 value=zoo}
----
L0.0:
  000004:[a#9,SET-d#9,SET] seqnums:[9-9] points:[a#9,SET-d#9,SET] size:871 blobrefs:[(B100001: 1); depth:1]
  000005:[e#1,SET-z#1,SET] seqnums:[1-1] points:[e#1,SET-z#1,SET] size:921 blobrefs:[(B100002: 3), (B100003: 3), (B100004: 3); depth:3]
Blob files:
  B100001 physical:{100001 size:[90 (90B)] vals:[1 (1B)]}
  B100002 physical:{100002 size:[92 (92B)] vals:[3 (3B)]}
  B100003 physical:{100003 size:[92 (92B)] vals:[3 (3B)]}
  B100004 physical:{100004 size:[92 (92B)] vals:[3 (3B)]}

compact a-z
----
L1:
  000006:[a#0,SET-z#0,SET] seqnums:[0-0] points:[a#0,SET-z#0,SET] size:944 blobrefs:[(B100001: 1), (B100002: 3), (B100003: 3), (B100004: 3); depth:3]
Blob files:
  B100001 physical:{100001 size:[90 (90B)] vals:[1 (1B)]}
  B100002 physical:{100002 size:[92 (92B)] vals:[3 (3B)]}
  B100003 physical:{100003 size:[92 (92B)] vals:[3 (3B)]}
  B100004 physical:{100004 size:[92 (92B)] vals:[3 (3B)]}


# Configure a database with a minimum rewrite age of 0s (no delay) and a target
# garbage ratio of 0.0 (no garbage). With this configuration, any blob file that
# contains any unreferenced values should be immediately compacted.

define value-separation=(true,1,2,0s,0.0)
----

batch
set a apple
set b banana
set c coconut
set d dragonfruit
set e elderberry
set f fig
set g grapefruit
set h honeydew
----

flush
----
L0.0:
  000005:[a#10,SET-h#17,SET] seqnums:[10-17] points:[a#10,SET-h#17,SET] size:954 blobrefs:[(B000006: 60); depth:1]
Blob files:
  B000006 physical:{000006 size:[156 (156B)] vals:[60 (60B)]}

# Overwrite the value of the key 'c'.

batch
set c cherry
----

flush
----
L0.1:
  000008:[c#18,SET-c#18,SET] seqnums:[18-18] points:[c#18,SET-c#18,SET] size:858 blobrefs:[(B000009: 6); depth:1]
L0.0:
  000005:[a#10,SET-h#17,SET] seqnums:[10-17] points:[a#10,SET-h#17,SET] size:954 blobrefs:[(B000006: 60); depth:1]
Blob files:
  B000006 physical:{000006 size:[156 (156B)] vals:[60 (60B)]}
  B000009 physical:{000009 size:[95 (95B)] vals:[6 (6B)]}

# Compacting the two sstables will result in 'coconut' in the first blob file
# becoming unreferenced.

compact a-b
----
L6:
  000010:[a#0,SET-h#0,SET] seqnums:[0-0] points:[a#0,SET-h#0,SET] size:932 blobrefs:[(B000006: 53), (B000009: 6); depth:2]
Blob files:
  B000006 physical:{000006 size:[156 (156B)] vals:[60 (60B)]}
  B000009 physical:{000009 size:[95 (95B)] vals:[6 (6B)]}

auto-compact
----
L6:
  000010:[a#0,SET-h#0,SET] seqnums:[0-0] points:[a#0,SET-h#0,SET] size:932 blobrefs:[(B000006: 53), (B000009: 6); depth:2]
Blob files:
  B000006 physical:{000011 size:[150 (150B)] vals:[53 (53B)]}
  B000009 physical:{000009 size:[95 (95B)] vals:[6 (6B)]}

metrics
----
      |                             |                |       |   ingested   |     moved    |    written   |       |    amp   |    val sep
level | tables  size val-bl vtables | score  ff  cff |   in  | tables  size | tables  size | tables  size |  read |   r   w  | refsz  valblk
------+-----------------------------+----------------+-------+--------------+--------------+--------------+-------+----------+--------------
    0 |     0     0B     0B       0 |    -    0    0 |  156B |     0     0B |     0     0B |     2  1.8KB |    0B |   0 14.8 |    0B      0B
    1 |     0     0B     0B       0 |    -    0    0 |    0B |     0     0B |     0     0B |     0     0B |    0B |   0    0 |    0B      0B
    2 |     0     0B     0B       0 |    -    0    0 |    0B |     0     0B |     0     0B |     0     0B |    0B |   0    0 |    0B      0B
    3 |     0     0B     0B       0 |    -    0    0 |    0B |     0     0B |     0     0B |     0     0B |    0B |   0    0 |    0B      0B
    4 |     0     0B     0B       0 |    -    0    0 |    0B |     0     0B |     0     0B |     0     0B |    0B |   0    0 |    0B      0B
    5 |     0     0B     0B       0 |    -    0    0 |    0B |     0     0B |     0     0B |     0     0B |    0B |   0    0 |    0B      0B
    6 |     1   932B     0B       0 |    - 0.00 0.00 | 1.8KB |     0     0B |     0     0B |     1   932B | 1.8KB |   1 0.51 |  232B      0B
total |     1   932B     0B       0 |    -    -    - |  156B |     0     0B |     0     0B |     3  2.8KB | 1.8KB |   1 21.8 |  232B      0B
--------------------------------------------------------------------------------------------------------------------------------------------
WAL: 1 files (0B)  in: 126B  written: 156B (24% overhead)
Flushes: 2
Compactions: 2  estimated debt: 0B  in progress: 0 (0B)  canceled: 0 (0B)  failed: 0  problem spans: 0
             default: 1  delete: 0  elision: 0  move: 0  read: 0  tombstone-density: 0  rewrite: 0  copy: 0  multi-level: 0  blob-file-rewrite:  1
MemTables: 1 (256KB)  zombie: 1 (256KB)
Zombie tables: 0 (0B, local: 0B)
Backing tables: 0 (0B)
Virtual tables: 0 (0B)
Local tables size: 932B
Compression types: snappy: 1
Table stats: all loaded
Block cache: 6 entries (2.3KB)  hit rate: 48.6%
File cache: 1 tables, 2 blobfiles (472B)  hit rate: 73.9%
Range key sets: 0  Tombstones: 0  Total missized tombstones encountered: 0
Snapshots: 0  earliest seq num: 0
Table iters: 0
Filter utility: 0.0%
Ingestions: 0  as flushable: 0 (0B in 0 tables)
Cgo memory usage: 0B  block cache: 0B (data: 0B, maps: 0B, entries: 0B)  memtables: 0B

# Test a blob file rewrite compaction with virtual sstable references.

define value-separation=(true,1,10,0s,0.01)
----

batch
set a apple
set b banana
set c coconut
----

compact a-b
----
L6:
  000005:[a#10,SET-c#12,SET] seqnums:[10-12] points:[a#10,SET-c#12,SET] size:875 blobrefs:[(B000006: 18); depth:1]
Blob files:
  B000006 physical:{000006 size:[109 (109B)] vals:[18 (18B)]}

excise b ba
----
L6:
  000007(000005):[a#10,SET-a#10,SET] seqnums:[10-12] points:[a#10,SET-a#10,SET] size:104(875) blobrefs:[(B000006: 2); depth:1]
  000008(000005):[c#12,SET-c#12,SET] seqnums:[10-12] points:[c#12,SET-c#12,SET] size:104(875) blobrefs:[(B000006: 2); depth:1]
Blob files:
  B000006 physical:{000006 size:[109 (109B)] vals:[18 (18B)]}

# Run a blob-rewrite compaction. It'll rewrite the blob file, but it won't
# actually reclaim disk space. This is a known limitation due to the lack of
# accurate blob value liveness for virtual sstables. See
# https://github.com/cockroachdb/pebble/v2/issues/4915.

run-blob-rewrite-compaction
----
L6:
  000007(000005):[a#10,SET-a#10,SET] seqnums:[10-12] points:[a#10,SET-a#10,SET] size:104(875) blobrefs:[(B000006: 2); depth:1]
  000008(000005):[c#12,SET-c#12,SET] seqnums:[10-12] points:[c#12,SET-c#12,SET] size:104(875) blobrefs:[(B000006: 2); depth:1]
Blob files:
  B000006 physical:{000009 size:[110 (110B)] vals:[18 (18B)]}

define value-separation=(true,5,5,0s,1.0) l0-compaction-threshold=1
----

# Test writing a non-trivial amount of data. With a key length of 4, we'll write
# 475254 keys each with a 64-byte value, totalling ~30MB of value data.

populate keylen=4 timestamps=(1) vallen=64
----
wrote 475254 keys

# Flush the memtable. The resulting L0 sstables should be relatively small, but
# when their sizes are summed with their corresponding blob files, the sum
# should be around the target file size of 2MB.

flush
----
L0.0:
  000005:[a@1#10,SET-bkmx@1#25669,SET] seqnums:[10-25669] points:[a@1#10,SET-bkmx@1#25669,SET] size:396639 blobrefs:[(B000006: 1642240); depth:1]
  000007:[bkmy@1#25670,SET-cv@1#51332,SET] seqnums:[25670-51332] points:[bkmy@1#25670,SET-cv@1#51332,SET] size:396466 blobrefs:[(B000008: 1642432); depth:1]
  000009:[cva@1#51333,SET-efnh@1#77002,SET] seqnums:[51333-77002] points:[cva@1#51333,SET-efnh@1#77002,SET] size:395950 blobrefs:[(B000010: 1642880); depth:1]
  000011:[efni@1#77003,SET-fqaj@1#102665,SET] seqnums:[77003-102665] points:[efni@1#77003,SET-fqaj@1#102665,SET] size:396383 blobrefs:[(B000012: 1642432); depth:1]
  000013:[fqak@1#102666,SET-hamh@1#128297,SET] seqnums:[102666-128297] points:[fqak@1#102666,SET-hamh@1#128297,SET] size:398462 blobrefs:[(B000014: 1640448); depth:1]
  000015:[hami@1#128298,SET-ikzi@1#153958,SET] seqnums:[128298-153958] points:[hami@1#128298,SET-ikzi@1#153958,SET] size:396585 blobrefs:[(B000016: 1642304); depth:1]
  000017:[ikzj@1#153959,SET-jvoe@1#179669,SET] seqnums:[153959-179669] points:[ikzj@1#153959,SET-jvoe@1#179669,SET] size:393162 blobrefs:[(B000018: 1645504); depth:1]
  000019:[jvof@1#179670,SET-lgaf@1#205305,SET] seqnums:[179670-205305] points:[jvof@1#179670,SET-lgaf@1#205305,SET] size:397687 blobrefs:[(B000020: 1640704); depth:1]
  000021:[lgag@1#205306,SET-mqno@1#230974,SET] seqnums:[205306-230974] points:[lgag@1#205306,SET-mqno@1#230974,SET] size:396029 blobrefs:[(B000022: 1642816); depth:1]
  000023:[mqnp@1#230975,SET-obac@1#256624,SET] seqnums:[230975-256624] points:[mqnp@1#230975,SET-obac@1#256624,SET] size:397283 blobrefs:[(B000024: 1641600); depth:1]
  000025:[obad@1#256625,SET-plml@1#282266,SET] seqnums:[256625-282266] points:[obad@1#256625,SET-plml@1#282266,SET] size:397834 blobrefs:[(B000026: 1641088); depth:1]
  000027:[plmm@1#282267,SET-qvzf@1#307920,SET] seqnums:[282267-307920] points:[plmm@1#282267,SET-qvzf@1#307920,SET] size:396981 blobrefs:[(B000028: 1641856); depth:1]
  000029:[qvzg@1#307921,SET-sgld@1#333553,SET] seqnums:[307921-333553] points:[qvzg@1#307921,SET-sgld@1#333553,SET] size:398392 blobrefs:[(B000030: 1640512); depth:1]
  000031:[sgle@1#333554,SET-tqxr@1#359200,SET] seqnums:[333554-359200] points:[sgle@1#333554,SET-tqxr@1#359200,SET] size:397496 blobrefs:[(B000032: 1641408); depth:1]
  000033:[tqxs@1#359201,SET-vbls@1#384890,SET] seqnums:[359201-384890] points:[tqxs@1#359201,SET-vbls@1#384890,SET] size:394570 blobrefs:[(B000034: 1644160); depth:1]
  000035:[vblt@1#384891,SET-wlyf@1#410537,SET] seqnums:[384891-410537] points:[vblt@1#384891,SET-wlyf@1#410537,SET] size:397494 blobrefs:[(B000036: 1641408); depth:1]
  000037:[wlyg@1#410538,SET-xwmc@1#436222,SET] seqnums:[410538-436222] points:[wlyg@1#410538,SET-xwmc@1#436222,SET] size:394940 blobrefs:[(B000038: 1643840); depth:1]
  000039:[xwmd@1#436223,SET-zhar@1#461926,SET] seqnums:[436223-461926] points:[xwmd@1#436223,SET-zhar@1#461926,SET] size:393606 blobrefs:[(B000040: 1645056); depth:1]
  000041:[zhas@1#461927,SET-zzzz@1#475263,SET] seqnums:[461927-475263] points:[zhas@1#461927,SET-zzzz@1#475263,SET] size:208259 blobrefs:[(B000042: 853568); depth:1]
Blob files:
  B000006 physical:{000006 size:[1704578 (1.6MB)] vals:[1642240 (1.6MB)]}
  B000008 physical:{000008 size:[1704776 (1.6MB)] vals:[1642432 (1.6MB)]}
  B000010 physical:{000010 size:[1705238 (1.6MB)] vals:[1642880 (1.6MB)]}
  B000012 physical:{000012 size:[1704776 (1.6MB)] vals:[1642432 (1.6MB)]}
  B000014 physical:{000014 size:[1702730 (1.6MB)] vals:[1640448 (1.6MB)]}
  B000016 physical:{000016 size:[1704644 (1.6MB)] vals:[1642304 (1.6MB)]}
  B000018 physical:{000018 size:[1707970 (1.6MB)] vals:[1645504 (1.6MB)]}
  B000020 physical:{000020 size:[1702994 (1.6MB)] vals:[1640704 (1.6MB)]}
  B000022 physical:{000022 size:[1705172 (1.6MB)] vals:[1642816 (1.6MB)]}
  B000024 physical:{000024 size:[1703918 (1.6MB)] vals:[1641600 (1.6MB)]}
  B000026 physical:{000026 size:[1703390 (1.6MB)] vals:[1641088 (1.6MB)]}
  B000028 physical:{000028 size:[1704182 (1.6MB)] vals:[1641856 (1.6MB)]}
  B000030 physical:{000030 size:[1702796 (1.6MB)] vals:[1640512 (1.6MB)]}
  B000032 physical:{000032 size:[1703720 (1.6MB)] vals:[1641408 (1.6MB)]}
  B000034 physical:{000034 size:[1706584 (1.6MB)] vals:[1644160 (1.6MB)]}
  B000036 physical:{000036 size:[1703720 (1.6MB)] vals:[1641408 (1.6MB)]}
  B000038 physical:{000038 size:[1706254 (1.6MB)] vals:[1643840 (1.6MB)]}
  B000040 physical:{000040 size:[1707508 (1.6MB)] vals:[1645056 (1.6MB)]}
  B000042 physical:{000042 size:[886008 (865KB)] vals:[853568 (834KB)]}

# Schedule automatic compactions. These compactions should write data to L6. The
# resulting sstables will reference multiple blob files but maintain a blob
# reference depth of 1 because L6 has no referenced blob files and all the L0
# input tables have a reference depth of 1.

auto-compact
----
L6:
  000044:[a@1#0,SET-czms@1#0,SET] seqnums:[0-0] points:[a@1#0,SET-czms@1#0,SET] size:715291 blobrefs:[(B000006: 1642240), (B000008: 1642432), (B000010: 201984); depth:1]
  000045:[czmt@1#0,SET-fyxn@1#0,SET] seqnums:[0-0] points:[czmt@1#0,SET-fyxn@1#0,SET] size:718640 blobrefs:[(B000010: 1440896), (B000012: 1642432), (B000014: 399936); depth:1]
  000046:[fyxo@1#0,SET-iykr@1#0,SET] seqnums:[0-0] points:[fyxo@1#0,SET-iykr@1#0,SET] size:714594 blobrefs:[(B000014: 1240512), (B000016: 1642304), (B000018: 604544); depth:1]
  000047:[iyks@1#0,SET-lxxi@1#0,SET] seqnums:[0-0] points:[iyks@1#0,SET-lxxi@1#0,SET] size:715507 blobrefs:[(B000018: 1040960), (B000020: 1640704), (B000022: 804800); depth:1]
  000048:[lxxj@1#0,SET-oxiv@1#0,SET] seqnums:[0-0] points:[lxxj@1#0,SET-oxiv@1#0,SET] size:716969 blobrefs:[(B000022: 838016), (B000024: 1641600), (B000026: 1004864); depth:1]
  000049:[oxiw@1#0,SET-rwta@1#0,SET] seqnums:[0-0] points:[oxiw@1#0,SET-rwta@1#0,SET] size:719355 blobrefs:[(B000026: 636224), (B000028: 1641856), (B000030: 1204160); depth:1]
  000050:[rwtb@1#0,SET-uwen@1#0,SET] seqnums:[0-0] points:[rwtb@1#0,SET-uwen@1#0,SET] size:717499 blobrefs:[(B000030: 436352), (B000032: 1641408), (B000034: 1406720); depth:1]
  000051:[uweo@1#0,SET-xvqm@1#0,SET] seqnums:[0-0] points:[uweo@1#0,SET-xvqm@1#0,SET] size:716744 blobrefs:[(B000034: 237440), (B000036: 1641408), (B000038: 1606400); depth:1]
  000052:[xvqn@1#0,SET-zzzz@1#0,SET] seqnums:[0-0] points:[xvqn@1#0,SET-zzzz@1#0,SET] size:521142 blobrefs:[(B000038: 37440), (B000040: 1645056), (B000042: 853568); depth:1]
Blob files:
  B000006 physical:{000006 size:[1704578 (1.6MB)] vals:[1642240 (1.6MB)]}
  B000008 physical:{000008 size:[1704776 (1.6MB)] vals:[1642432 (1.6MB)]}
  B000010 physical:{000010 size:[1705238 (1.6MB)] vals:[1642880 (1.6MB)]}
  B000012 physical:{000012 size:[1704776 (1.6MB)] vals:[1642432 (1.6MB)]}
  B000014 physical:{000014 size:[1702730 (1.6MB)] vals:[1640448 (1.6MB)]}
  B000016 physical:{000016 size:[1704644 (1.6MB)] vals:[1642304 (1.6MB)]}
  B000018 physical:{000018 size:[1707970 (1.6MB)] vals:[1645504 (1.6MB)]}
  B000020 physical:{000020 size:[1702994 (1.6MB)] vals:[1640704 (1.6MB)]}
  B000022 physical:{000022 size:[1705172 (1.6MB)] vals:[1642816 (1.6MB)]}
  B000024 physical:{000024 size:[1703918 (1.6MB)] vals:[1641600 (1.6MB)]}
  B000026 physical:{000026 size:[1703390 (1.6MB)] vals:[1641088 (1.6MB)]}
  B000028 physical:{000028 size:[1704182 (1.6MB)] vals:[1641856 (1.6MB)]}
  B000030 physical:{000030 size:[1702796 (1.6MB)] vals:[1640512 (1.6MB)]}
  B000032 physical:{000032 size:[1703720 (1.6MB)] vals:[1641408 (1.6MB)]}
  B000034 physical:{000034 size:[1706584 (1.6MB)] vals:[1644160 (1.6MB)]}
  B000036 physical:{000036 size:[1703720 (1.6MB)] vals:[1641408 (1.6MB)]}
  B000038 physical:{000038 size:[1706254 (1.6MB)] vals:[1643840 (1.6MB)]}
  B000040 physical:{000040 size:[1707508 (1.6MB)] vals:[1645056 (1.6MB)]}
  B000042 physical:{000042 size:[886008 (865KB)] vals:[853568 (834KB)]}


excise-dryrun b c
----
would excise 1 files.
  del-table:     L6 000044
  add-table:     L6 000053(000044):[a@1#0,SET-azzz@1#0,SET] seqnums:[0-0] points:[a@1#0,SET-azzz@1#0,SET] size:242560(715291) blobrefs:[(B000006: 556894), (B000008: 556959), (B000010: 68494); depth:1]
  add-table:     L6 000054(000044):[c@1#0,SET-czms@1#0,SET] seqnums:[0-0] points:[c@1#0,SET-czms@1#0,SET] size:230320(715291) blobrefs:[(B000006: 528792), (B000008: 528854), (B000010: 65037); depth:1]
  add-backing:   000044
