Skip to content

Commit 2058c06

Browse files
authored
Merge pull request #619 from IntersectMBO/jeltsch/ordinary-indexes-as-default
Make ordinary indexes the default
2 parents c58e3e1 + 610e9b7 commit 2058c06

File tree

6 files changed

+21
-8
lines changed

6 files changed

+21
-8
lines changed

bench/macro/lsm-tree-bench-wp8.hs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ import Database.LSMTree.Internal.ByteString (byteArrayToSBS)
7979
-- using only use public lsm-tree interface
8080
import qualified Database.LSMTree.Normal as LSM
8181

82+
-------------------------------------------------------------------------------
83+
-- Table configuration
84+
-------------------------------------------------------------------------------
85+
86+
benchTableConfig :: LSM.TableConfig
87+
benchTableConfig =
88+
LSM.defaultTableConfig {LSM.confFencePointerIndex = LSM.CompactIndex}
89+
8290
-------------------------------------------------------------------------------
8391
-- Keys and values
8492
-------------------------------------------------------------------------------
@@ -407,7 +415,7 @@ doSetup' gopts opts = do
407415
LSM.mkSnapshotName "bench"
408416

409417
LSM.withSession (mkTracer gopts) hasFS hasBlockIO (FS.mkFsPath []) $ \session -> do
410-
tbl <- LSM.new @IO @K @V @B session (mkTableConfigSetup gopts opts LSM.defaultTableConfig)
418+
tbl <- LSM.new @IO @K @V @B session (mkTableConfigSetup gopts opts benchTableConfig)
411419

412420
forM_ (groupsOfN 256 [ 0 .. initialSize gopts ]) $ \batch -> do
413421
-- TODO: this procedure simply inserts all the keys into initial lsm tree
@@ -576,7 +584,7 @@ doRun gopts opts = do
576584
-- reference version starts with empty (as it's not practical or
577585
-- necessary for testing to load the whole snapshot).
578586
tbl <- if check opts
579-
then LSM.new @IO @K @V @B session (mkTableConfigRun gopts LSM.defaultTableConfig)
587+
then LSM.new @IO @K @V @B session (mkTableConfigRun gopts benchTableConfig)
580588
else LSM.openSnapshot @IO @K @V @B session (mkTableConfigOverride gopts) label name
581589

582590
-- In checking mode, compare each output against a pure reference.

bench/micro/Bench/Database/LSMTree/Monoidal.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ instance Monoidal.ResolveValue V where
5555

5656
benchConfig :: Common.TableConfig
5757
benchConfig = Common.defaultTableConfig {
58-
Common.confWriteBufferAlloc = Common.AllocNumEntries (Common.NumEntries 20000)
58+
Common.confWriteBufferAlloc = Common.AllocNumEntries (Common.NumEntries 20000)
59+
, Common.confFencePointerIndex = Common.CompactIndex
5960
}
6061

6162
{-------------------------------------------------------------------------------

bench/micro/Bench/Database/LSMTree/Normal.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ newtype B2 = B2 ShortByteString
6464

6565
benchConfig :: Common.TableConfig
6666
benchConfig = Common.defaultTableConfig {
67-
Common.confWriteBufferAlloc = Common.AllocNumEntries (Common.NumEntries 20000)
67+
Common.confWriteBufferAlloc = Common.AllocNumEntries (Common.NumEntries 20000)
68+
, Common.confFencePointerIndex = Common.CompactIndex
6869
}
6970

7071
{-------------------------------------------------------------------------------
@@ -231,7 +232,7 @@ benchInsertBatches =
231232
!batchSize = 256
232233

233234
_benchConfig :: Common.TableConfig
234-
_benchConfig = Common.defaultTableConfig {
235+
_benchConfig = benchConfig {
235236
Common.confWriteBufferAlloc = Common.AllocNumEntries (Common.NumEntries 1000)
236237
}
237238

src/Database/LSMTree/Internal/Config.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ defaultTableConfig =
9292
, confSizeRatio = Four
9393
, confWriteBufferAlloc = AllocNumEntries (NumEntries 20_000)
9494
, confBloomFilterAlloc = defaultBloomFilterAlloc
95-
, confFencePointerIndex = CompactIndex
95+
, confFencePointerIndex = OrdinaryIndex
9696
, confDiskCachePolicy = DiskCacheAll
9797
, confMergeSchedule = defaultMergeSchedule
9898
}

test/Test/Database/LSMTree/Internal/Snapshot/Codec/Golden.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ basicSnapshotTableType :: (ComponentAnnotation, SnapshotTableType)
169169
basicSnapshotTableType = head enumerateSnapshotTableType
170170

171171
basicTableConfig :: (ComponentAnnotation, TableConfig)
172-
basicTableConfig = ( fuseAnnotations $ "T0" : replicate 4 blank, defaultTableConfig)
172+
basicTableConfig = ( fuseAnnotations $ "T0" : replicate 4 blank
173+
, defaultTableConfig {confFencePointerIndex = CompactIndex}
174+
)
173175

174176
basicRunNumber :: RunNumber
175177
basicRunNumber = enumerateRunNumbers

test/Test/Database/LSMTree/Internal/Snapshot/FS.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ prop_flipSnapshotBit (Positive (Small bufferSize)) es pickFileBit =
208208
namedSnapDir = namedSnapshotDir (SessionRoot root) snapName
209209

210210
conf = defaultTableConfig {
211-
confWriteBufferAlloc = AllocNumEntries (NumEntries bufferSize)
211+
confWriteBufferAlloc = AllocNumEntries (NumEntries bufferSize)
212+
, confFencePointerIndex = CompactIndex
212213
}
213214
es' = fmap (bimap serialiseKey (bimap serialiseValue serialiseBlob)) es
214215

0 commit comments

Comments
 (0)