Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Database.LSMTree.Internal.Config
Synopsis
- newtype LevelNo = LevelNo Int
- data TableConfig = TableConfig {}
- defaultTableConfig :: TableConfig
- data RunLevelNo
- runParamsForLevel :: TableConfig -> RunLevelNo -> RunParams
- data MergePolicy = LazyLevelling
- data SizeRatio = Four
- sizeRatioInt :: SizeRatio -> Int
- data WriteBufferAlloc = AllocNumEntries !Int
- data BloomFilterAlloc
- bloomFilterAllocForLevel :: TableConfig -> RunLevelNo -> RunBloomFilterAlloc
- data FencePointerIndexType
- indexTypeForRun :: FencePointerIndexType -> IndexType
- serialiseKeyMinimalSize :: SerialiseKey k => k -> Bool
- data DiskCachePolicy
- diskCachePolicyForLevel :: DiskCachePolicy -> RunLevelNo -> RunDataCaching
- data MergeSchedule
Documentation
Instances
Enum LevelNo Source # | |
Show LevelNo Source # | |
NFData LevelNo Source # | |
Defined in Database.LSMTree.Internal.Config | |
Eq LevelNo Source # | |
Ord LevelNo Source # | |
Defined in Database.LSMTree.Internal.Config |
Table configuration
data TableConfig Source #
A collection of configuration parameters for tables, which can be used to tune the performance of the table.
To construct a TableConfig
, modify the defaultTableConfig
, which defines reasonable defaults for all parameters.
For a detailed discussion of fine-tuning the table configuration, see Fine-tuning Table Configuration.
confMergePolicy ::
MergePolicy
- The merge policy balances the performance of lookups against the performance of updates. Levelling favours lookups. Tiering favours updates. Lazy levelling strikes a middle ground between levelling and tiering, and moderately favours updates. This parameter is explicitly referenced in the documentation of those operations it affects.
confSizeRatio ::
SizeRatio
- The size ratio pushes the effects of the merge policy to the extreme. If the size ratio is higher, levelling favours lookups more, and tiering and lazy levelling favour updates more. This parameter is referred to as \(T\) in the disk I/O cost of operations.
confWriteBufferAlloc ::
WriteBufferAlloc
- The write buffer capacity balances the performance of lookups and updates against the in-memory size of the database. If the write buffer is larger, it takes up more memory, but lookups and updates are more efficient. This parameter is referred to as \(B\) in the disk I/O cost of operations. Irrespective of this parameter, the write buffer size cannot exceed 4GiB.
confMergeSchedule ::
MergeSchedule
- The merge schedule balances the performance of lookups and updates against the consistency of updates. The merge schedule does not affect the performance of table unions. With the one-shot merge schedule, lookups and updates are more efficient overall, but some updates may take much longer than others. With the incremental merge schedule, lookups and updates are less efficient overall, but each update does a similar amount of work. This parameter is explicitly referenced in the documentation of those operations it affects.
confBloomFilterAlloc ::
BloomFilterAlloc
- The Bloom filter size balances the performance of lookups against the in-memory size of the database. If the Bloom filters are larger, they take up more memory, but lookup operations are more efficient.
confFencePointerIndex ::
FencePointerIndexType
- The fence-pointer index type supports two types of indexes. The ordinary indexes are designed to work with any key. The compact indexes are optimised for the case where the keys in the database are uniformly distributed, e.g., when the keys are hashes.
confDiskCachePolicy ::
DiskCachePolicy
- The disk cache policy supports caching lookup operations using the OS page cache. Caching may improve the performance of lookups if database access follows certain patterns.
Constructors
TableConfig | |
Instances
Show TableConfig Source # | |
Defined in Database.LSMTree.Internal.Config Methods showsPrec :: Int -> TableConfig -> ShowS # show :: TableConfig -> String # showList :: [TableConfig] -> ShowS # | |
NFData TableConfig Source # | |
Defined in Database.LSMTree.Internal.Config Methods rnf :: TableConfig -> () # | |
Eq TableConfig Source # | |
Defined in Database.LSMTree.Internal.Config | |
DecodeVersioned TableConfig Source # | |
Defined in Database.LSMTree.Internal.Snapshot.Codec Methods decodeVersioned :: SnapshotVersion -> Decoder s TableConfig Source # | |
Encode TableConfig Source # | |
Defined in Database.LSMTree.Internal.Snapshot.Codec Methods encode :: TableConfig -> Encoding Source # |
defaultTableConfig :: TableConfig Source #
The defaultTableConfig
defines reasonable defaults for all TableConfig
parameters.
>>>
confMergePolicy defaultTableConfig
LazyLevelling>>>
confMergeSchedule defaultTableConfig
Incremental>>>
confSizeRatio defaultTableConfig
Four>>>
confWriteBufferAlloc defaultTableConfig
AllocNumEntries 20000>>>
confBloomFilterAlloc defaultTableConfig
AllocRequestFPR 1.0e-3>>>
confFencePointerIndex defaultTableConfig
OrdinaryIndex>>>
confDiskCachePolicy defaultTableConfig
DiskCacheAll
data RunLevelNo Source #
Constructors
RegularLevel LevelNo | |
UnionLevel |
runParamsForLevel :: TableConfig -> RunLevelNo -> RunParams Source #
Merge policy
data MergePolicy Source #
The merge policy balances the performance of lookups against the performance of updates. Levelling favours lookups. Tiering favours updates. Lazy levelling strikes a middle ground between levelling and tiering, and moderately favours updates. This parameter is explicitly referenced in the documentation of those operations it affects.
NOTE: This package only supports lazy levelling.
For a detailed discussion of the merge policy, see Fine-tuning: Merge Policy, Size Ratio, and Write Buffer Size.
Constructors
LazyLevelling |
Instances
Show MergePolicy Source # | |
Defined in Database.LSMTree.Internal.Config Methods showsPrec :: Int -> MergePolicy -> ShowS # show :: MergePolicy -> String # showList :: [MergePolicy] -> ShowS # | |
NFData MergePolicy Source # | |
Defined in Database.LSMTree.Internal.Config Methods rnf :: MergePolicy -> () # | |
Eq MergePolicy Source # | |
Defined in Database.LSMTree.Internal.Config | |
DecodeVersioned MergePolicy Source # | |
Defined in Database.LSMTree.Internal.Snapshot.Codec Methods decodeVersioned :: SnapshotVersion -> Decoder s MergePolicy Source # | |
Encode MergePolicy Source # | |
Defined in Database.LSMTree.Internal.Snapshot.Codec Methods encode :: MergePolicy -> Encoding Source # |
Size ratio
The size ratio pushes the effects of the merge policy to the extreme. If the size ratio is higher, levelling favours lookups more, and tiering and lazy levelling favour updates more. This parameter is referred to as \(T\) in the disk I/O cost of operations.
NOTE: This package only supports a size ratio of four.
For a detailed discussion of the size ratio, see Fine-tuning: Merge Policy, Size Ratio, and Write Buffer Size.
Constructors
Four |
Instances
Show SizeRatio Source # | |
NFData SizeRatio Source # | |
Defined in Database.LSMTree.Internal.Config | |
Eq SizeRatio Source # | |
DecodeVersioned SizeRatio Source # | |
Defined in Database.LSMTree.Internal.Snapshot.Codec Methods decodeVersioned :: SnapshotVersion -> Decoder s SizeRatio Source # | |
Encode SizeRatio Source # | |
sizeRatioInt :: SizeRatio -> Int Source #
Write buffer allocation
data WriteBufferAlloc Source #
The write buffer capacity balances the performance of lookups and updates against the in-memory size of the table. If the write buffer is larger, it takes up more memory, but lookups and updates are more efficient. Irrespective of this parameter, the write buffer size cannot exceed 4GiB.
For a detailed discussion of the size ratio, see Fine-tuning: Merge Policy, Size Ratio, and Write Buffer Size.
Constructors
AllocNumEntries !Int | Allocate space for the in-memory write buffer to fit the requested number of entries. This parameter is referred to as \(B\) in the disk I/O cost of operations. |
Instances
Show WriteBufferAlloc Source # | |
Defined in Database.LSMTree.Internal.Config Methods showsPrec :: Int -> WriteBufferAlloc -> ShowS # show :: WriteBufferAlloc -> String # showList :: [WriteBufferAlloc] -> ShowS # | |
NFData WriteBufferAlloc Source # | |
Defined in Database.LSMTree.Internal.Config Methods rnf :: WriteBufferAlloc -> () # | |
Eq WriteBufferAlloc Source # | |
Defined in Database.LSMTree.Internal.Config Methods (==) :: WriteBufferAlloc -> WriteBufferAlloc -> Bool # (/=) :: WriteBufferAlloc -> WriteBufferAlloc -> Bool # | |
DecodeVersioned WriteBufferAlloc Source # | |
Defined in Database.LSMTree.Internal.Snapshot.Codec Methods decodeVersioned :: SnapshotVersion -> Decoder s WriteBufferAlloc Source # | |
Encode WriteBufferAlloc Source # | |
Defined in Database.LSMTree.Internal.Snapshot.Codec Methods encode :: WriteBufferAlloc -> Encoding Source # |
Bloom filter allocation
data BloomFilterAlloc Source #
The Bloom filter size balances the performance of lookups against the in-memory size of the table. If the Bloom filters are larger, they take up more memory, but lookup operations are more efficient.
For a detailed discussion of the Bloom filter size, see Fine-tuning: Bloom Filter Size.
Constructors
AllocFixed !Double | Allocate the requested number of bits per entry in the table. The value must strictly positive, but fractional values are permitted. The recommended range is \([2, 24]\). |
AllocRequestFPR !Double | Allocate the required number of bits per entry to get the requested false-positive rate. The value must be in the range \((0, 1)\). The recommended range is \([1\mathrm{e}{ -5 },1\mathrm{e}{ -2 }]\). |
Instances
Show BloomFilterAlloc Source # | |
Defined in Database.LSMTree.Internal.Config Methods showsPrec :: Int -> BloomFilterAlloc -> ShowS # show :: BloomFilterAlloc -> String # showList :: [BloomFilterAlloc] -> ShowS # | |
NFData BloomFilterAlloc Source # | |
Defined in Database.LSMTree.Internal.Config Methods rnf :: BloomFilterAlloc -> () # | |
Eq BloomFilterAlloc Source # | |
Defined in Database.LSMTree.Internal.Config Methods (==) :: BloomFilterAlloc -> BloomFilterAlloc -> Bool # (/=) :: BloomFilterAlloc -> BloomFilterAlloc -> Bool # | |
DecodeVersioned BloomFilterAlloc Source # | |
Defined in Database.LSMTree.Internal.Snapshot.Codec Methods decodeVersioned :: SnapshotVersion -> Decoder s BloomFilterAlloc Source # | |
Encode BloomFilterAlloc Source # | |
Defined in Database.LSMTree.Internal.Snapshot.Codec Methods encode :: BloomFilterAlloc -> Encoding Source # |
Fence pointer index
data FencePointerIndexType Source #
The fence-pointer index type supports two types of indexes. The ordinary indexes are designed to work with any key. The compact indexes are optimised for the case where the keys in the database are uniformly distributed, e.g., when the keys are hashes.
For a detailed discussion the fence-pointer index types, see Fine-tuning: Fence-Pointer Index Type.
Constructors
OrdinaryIndex | Ordinary indexes are designed to work with any key. When using an ordinary index, the |
CompactIndex | Compact indexes are designed for the case where the keys in the database are uniformly distributed, e.g., when the keys are hashes. When using a compact index, the
Use |
Instances
Show FencePointerIndexType Source # | |
Defined in Database.LSMTree.Internal.Config Methods showsPrec :: Int -> FencePointerIndexType -> ShowS # show :: FencePointerIndexType -> String # showList :: [FencePointerIndexType] -> ShowS # | |
NFData FencePointerIndexType Source # | |
Defined in Database.LSMTree.Internal.Config Methods rnf :: FencePointerIndexType -> () # | |
Eq FencePointerIndexType Source # | |
Defined in Database.LSMTree.Internal.Config Methods (==) :: FencePointerIndexType -> FencePointerIndexType -> Bool # (/=) :: FencePointerIndexType -> FencePointerIndexType -> Bool # | |
DecodeVersioned FencePointerIndexType Source # | |
Defined in Database.LSMTree.Internal.Snapshot.Codec Methods decodeVersioned :: SnapshotVersion -> Decoder s FencePointerIndexType Source # | |
Encode FencePointerIndexType Source # | |
Defined in Database.LSMTree.Internal.Snapshot.Codec Methods |
serialiseKeyMinimalSize :: SerialiseKey k => k -> Bool Source #
Test the Minimal size law for the CompactIndex
option.
Disk cache policy
data DiskCachePolicy Source #
The disk cache policy determines if lookup operations use the OS page cache. Caching may improve the performance of lookups if database access follows certain patterns.
For a detailed discussion the disk cache policy, see Fine-tuning: Disk Cache Policy.
Constructors
DiskCacheAll | Cache all data in the table. Use this policy if the database's access pattern has either good spatial locality or both good spatial and temporal locality. |
DiskCacheLevelOneTo !Int | Cache the data in the freshest Use this policy if the database's access pattern only has good temporal locality. The variable |
DiskCacheNone | Do not cache any table data. Use this policy if the database's access pattern has does not have good spatial or temporal locality. For instance, if the access pattern is uniformly random. |
Instances
Show DiskCachePolicy Source # | |
Defined in Database.LSMTree.Internal.Config Methods showsPrec :: Int -> DiskCachePolicy -> ShowS # show :: DiskCachePolicy -> String # showList :: [DiskCachePolicy] -> ShowS # | |
NFData DiskCachePolicy Source # | |
Defined in Database.LSMTree.Internal.Config Methods rnf :: DiskCachePolicy -> () # | |
Eq DiskCachePolicy Source # | |
Defined in Database.LSMTree.Internal.Config Methods (==) :: DiskCachePolicy -> DiskCachePolicy -> Bool # (/=) :: DiskCachePolicy -> DiskCachePolicy -> Bool # | |
DecodeVersioned DiskCachePolicy Source # | |
Defined in Database.LSMTree.Internal.Snapshot.Codec Methods decodeVersioned :: SnapshotVersion -> Decoder s DiskCachePolicy Source # | |
Encode DiskCachePolicy Source # | |
Defined in Database.LSMTree.Internal.Snapshot.Codec Methods encode :: DiskCachePolicy -> Encoding Source # |
diskCachePolicyForLevel :: DiskCachePolicy -> RunLevelNo -> RunDataCaching Source #
Interpret the DiskCachePolicy
for a level: should we cache data in runs
at this level.
Merge schedule
data MergeSchedule Source #
The merge schedule balances the performance of lookups and updates against the consistency of updates. The merge schedule does not affect the performance of table unions. With the one-shot merge schedule, lookups and updates are more efficient overall, but some updates may take much longer than others. With the incremental merge schedule, lookups and updates are less efficient overall, but each update does a similar amount of work. This parameter is explicitly referenced in the documentation of those operations it affects.
For a detailed discussion of the effect of the merge schedule, see Fine-tuning: Merge Schedule.
Constructors
OneShot | The |
Incremental | The |
Instances
Show MergeSchedule Source # | |
Defined in Database.LSMTree.Internal.Config Methods showsPrec :: Int -> MergeSchedule -> ShowS # show :: MergeSchedule -> String # showList :: [MergeSchedule] -> ShowS # | |
NFData MergeSchedule Source # | |
Defined in Database.LSMTree.Internal.Config Methods rnf :: MergeSchedule -> () # | |
Eq MergeSchedule Source # | |
Defined in Database.LSMTree.Internal.Config Methods (==) :: MergeSchedule -> MergeSchedule -> Bool # (/=) :: MergeSchedule -> MergeSchedule -> Bool # | |
DecodeVersioned MergeSchedule Source # | |
Defined in Database.LSMTree.Internal.Snapshot.Codec Methods decodeVersioned :: SnapshotVersion -> Decoder s MergeSchedule Source # | |
Encode MergeSchedule Source # | |
Defined in Database.LSMTree.Internal.Snapshot.Codec Methods encode :: MergeSchedule -> Encoding Source # |