Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
colblk: add keyspan block writer, reader, iterator
Add a columnar block schema for keyspans, used for range deletion and range keys. ``` goos: linux goarch: amd64 pkg: github.com/cockroachdb/pebble/sstable/colblk cpu: Intel(R) Xeon(R) CPU @ 2.80GHz │ old.log │ newer.log │ │ sec/op │ sec/op vs base │ KeyspanBlock_RangeDeletions/numSpans=1/keysPerSpan=1/keySize=10/SeekGE-24 156.20n ± 1% 73.42n ± 0% -53.00% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=1/keysPerSpan=1/keySize=10/Next-24 49.36n ± 0% 71.46n ± 0% +44.77% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=1/keysPerSpan=1/keySize=128/SeekGE-24 171.00n ± 0% 80.19n ± 0% -53.11% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=1/keysPerSpan=1/keySize=128/Next-24 54.04n ± 0% 71.32n ± 0% +31.98% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=1/keysPerSpan=2/keySize=10/SeekGE-24 292.45n ± 1% 88.55n ± 0% -69.72% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=1/keysPerSpan=2/keySize=10/Next-24 83.44n ± 0% 102.00n ± 0% +22.25% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=1/keysPerSpan=2/keySize=128/SeekGE-24 325.20n ± 0% 95.70n ± 0% -70.57% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=1/keysPerSpan=2/keySize=128/Next-24 95.14n ± 0% 102.20n ± 0% +7.42% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=1/keysPerSpan=5/keySize=10/SeekGE-24 916.0n ± 1% 135.9n ± 0% -85.16% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=1/keysPerSpan=5/keySize=10/Next-24 487.4n ± 1% 196.8n ± 0% -59.64% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=1/keysPerSpan=5/keySize=128/SeekGE-24 1061.5n ± 1% 143.6n ± 0% -86.47% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=1/keysPerSpan=5/keySize=128/Next-24 541.1n ± 0% 197.5n ± 0% -63.50% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=10/keysPerSpan=1/keySize=10/SeekGE-24 3602.5n ± 0% 138.1n ± 0% -96.17% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=10/keysPerSpan=1/keySize=10/Next-24 3608.50n ± 0% 69.97n ± 0% -98.06% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=10/keysPerSpan=1/keySize=128/SeekGE-24 3687.0n ± 0% 154.1n ± 0% -95.82% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=10/keysPerSpan=1/keySize=128/Next-24 3649.50n ± 0% 70.40n ± 0% -98.07% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=10/keysPerSpan=2/keySize=10/SeekGE-24 3958.0n ± 0% 166.4n ± 0% -95.80% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=10/keysPerSpan=2/keySize=10/Next-24 3700.0n ± 0% 100.8n ± 0% -97.28% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=10/keysPerSpan=2/keySize=128/SeekGE-24 4091.5n ± 0% 182.5n ± 0% -95.54% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=10/keysPerSpan=2/keySize=128/Next-24 3749.5n ± 0% 101.1n ± 0% -97.30% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=10/keysPerSpan=5/keySize=10/SeekGE-24 5440.5n ± 1% 251.3n ± 0% -95.38% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=10/keysPerSpan=5/keySize=10/Next-24 4626.0n ± 0% 196.6n ± 0% -95.75% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=10/keysPerSpan=5/keySize=128/SeekGE-24 5756.0n ± 0% 267.6n ± 0% -95.35% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=10/keysPerSpan=5/keySize=128/Next-24 4738.0n ± 0% 196.4n ± 0% -95.85% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=100/keysPerSpan=1/keySize=10/SeekGE-24 5528.5n ± 0% 200.8n ± 0% -96.37% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=100/keysPerSpan=1/keySize=10/Next-24 3611.00n ± 0% 70.10n ± 0% -98.06% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=100/keysPerSpan=1/keySize=128/SeekGE-24 5909.0n ± 0% 227.2n ± 0% -96.16% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=100/keysPerSpan=1/keySize=128/Next-24 3650.00n ± 0% 70.09n ± 0% -98.08% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=100/keysPerSpan=2/keySize=10/SeekGE-24 7137.0n ± 0% 231.7n ± 0% -96.75% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=100/keysPerSpan=2/keySize=10/Next-24 3697.5n ± 0% 101.0n ± 0% -97.27% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=100/keysPerSpan=2/keySize=128/SeekGE-24 7847.5n ± 0% 258.7n ± 0% -96.70% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=100/keysPerSpan=2/keySize=128/Next-24 3754.5n ± 0% 101.0n ± 0% -97.31% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=100/keysPerSpan=5/keySize=10/SeekGE-24 12801.5n ± 0% 324.1n ± 0% -97.47% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=100/keysPerSpan=5/keySize=10/Next-24 4644.5n ± 1% 195.8n ± 0% -95.79% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=100/keysPerSpan=5/keySize=128/SeekGE-24 14830.5n ± 0% 352.1n ± 0% -97.63% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=100/keysPerSpan=5/keySize=128/Next-24 4752.5n ± 1% 196.2n ± 0% -95.87% (p=0.000 n=10) geomean 1.746µ 137.7n -92.11% │ old.log │ newer.log │ │ bytes/row │ bytes/row vs base │ KeyspanBlock_RangeDeletions/numSpans=1/keysPerSpan=1/keySize=10/SeekGE-24 39.00 ± 0% 91.00 ± 0% +133.33% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=1/keysPerSpan=1/keySize=10/Next-24 39.00 ± 0% 91.00 ± 0% +133.33% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=1/keysPerSpan=1/keySize=128/SeekGE-24 277.0 ± 0% 331.0 ± 0% +19.49% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=1/keysPerSpan=1/keySize=128/Next-24 277.0 ± 0% 331.0 ± 0% +19.49% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=1/keysPerSpan=2/keySize=10/SeekGE-24 30.00 ± 0% 47.50 ± 0% +58.33% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=1/keysPerSpan=2/keySize=10/Next-24 30.00 ± 0% 47.50 ± 0% +58.33% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=1/keysPerSpan=2/keySize=128/SeekGE-24 209.0 ± 0% 167.5 ± 0% -19.86% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=1/keysPerSpan=2/keySize=128/Next-24 209.0 ± 0% 167.5 ± 0% -19.86% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=1/keysPerSpan=5/keySize=10/SeekGE-24 24.60 ± 0% 20.20 ± 0% -17.89% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=1/keysPerSpan=5/keySize=10/Next-24 24.60 ± 0% 20.20 ± 0% -17.89% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=1/keysPerSpan=5/keySize=128/SeekGE-24 168.20 ± 0% 68.20 ± 0% -59.45% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=1/keysPerSpan=5/keySize=128/Next-24 168.20 ± 0% 68.20 ± 0% -59.45% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=10/keysPerSpan=1/keySize=10/SeekGE-24 23.70 ± 0% 19.90 ± 0% -16.03% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=10/keysPerSpan=1/keySize=10/Next-24 23.70 ± 0% 19.90 ± 0% -16.03% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=10/keysPerSpan=1/keySize=128/SeekGE-24 154.6 ± 0% 151.0 ± 0% -2.33% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=10/keysPerSpan=1/keySize=128/Next-24 154.6 ± 0% 151.0 ± 0% -2.33% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=10/keysPerSpan=2/keySize=10/SeekGE-24 22.35 ± 0% 11.95 ± 0% -46.53% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=10/keysPerSpan=2/keySize=10/Next-24 22.35 ± 0% 11.95 ± 0% -46.53% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=10/keysPerSpan=2/keySize=128/SeekGE-24 147.80 ± 0% 77.55 ± 0% -47.53% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=10/keysPerSpan=2/keySize=128/Next-24 147.80 ± 0% 77.55 ± 0% -47.53% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=10/keysPerSpan=5/keySize=10/SeekGE-24 21.540 ± 0% 5.980 ± 0% -72.24% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=10/keysPerSpan=5/keySize=10/Next-24 21.540 ± 0% 5.980 ± 0% -72.24% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=10/keysPerSpan=5/keySize=128/SeekGE-24 143.70 ± 0% 32.22 ± 0% -77.58% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=10/keysPerSpan=5/keySize=128/Next-24 143.70 ± 0% 32.22 ± 0% -77.58% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=100/keysPerSpan=1/keySize=10/SeekGE-24 22.26 ± 0% 13.82 ± 0% -37.92% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=100/keysPerSpan=1/keySize=10/Next-24 22.26 ± 0% 13.82 ± 0% -37.92% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=100/keysPerSpan=1/keySize=128/SeekGE-24 142.4 ± 0% 133.0 ± 0% -6.60% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=100/keysPerSpan=1/keySize=128/Next-24 142.4 ± 0% 133.0 ± 0% -6.60% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=100/keysPerSpan=2/keySize=10/SeekGE-24 21.630 ± 0% 8.915 ± 0% -58.78% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=100/keysPerSpan=2/keySize=10/Next-24 21.630 ± 0% 8.915 ± 0% -58.78% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=100/keysPerSpan=2/keySize=128/SeekGE-24 141.70 ± 0% 68.50 ± 0% -51.66% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=100/keysPerSpan=2/keySize=128/Next-24 141.70 ± 0% 68.50 ± 0% -51.66% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=100/keysPerSpan=5/keySize=10/SeekGE-24 21.250 ± 0% 4.970 ± 0% -76.61% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=100/keysPerSpan=5/keySize=10/Next-24 21.250 ± 0% 4.970 ± 0% -76.61% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=100/keysPerSpan=5/keySize=128/SeekGE-24 141.30 ± 0% 28.81 ± 0% -79.61% (p=0.000 n=10) KeyspanBlock_RangeDeletions/numSpans=100/keysPerSpan=5/keySize=128/Next-24 141.30 ± 0% 28.81 ± 0% -79.61% (p=0.000 n=10) geomean 63.79 38.09 -40.29% ```
- Loading branch information