Class IndexRebuildOptions
How an open rebuilds the secondary indexes it cannot trust or load (a crash open, an added index, a migration): an external merge sort of the indexed keys and an ordered build of each tree, in a fixed memory budget whatever the data's size (#1588).
public sealed class IndexRebuildOptions
- Inheritance
-
IndexRebuildOptions
- Inherited Members
Constructors
IndexRebuildOptions()
public IndexRebuildOptions()
Fields
MaximumWorkers
The most worker threads Workers may name.
public const int MaximumWorkers = 64
Field Value
MinimumMemoryBudgetBytes
The smallest MemoryBudgetBytes: 16 MiB.
public const long MinimumMemoryBudgetBytes = 16777216
Field Value
Properties
LeafFillPercent
How full the rebuild fills the leaves of a unique tree whose keys do not grow with the entities' cluster locations: 90 % by default, 50..100. Each leaf keeps the rest free, so the first inserts after the open do not split it. A multi-value tree, and a unique tree whose keys do grow with location (a sequence number, a timestamp), are built full: their inserts land in a value buffer or at the rightmost leaf.
public int LeafFillPercent { get; set; }
Property Value
MemoryBudgetBytes
The native memory the rebuild may use, reused by each of its phases: 256 MiB by default, at least 16 MiB. It does not grow with the data: a larger archetype spills more sorted runs to the temp file instead. Independent of the page cache.
public long MemoryBudgetBytes { get; set; }
Property Value
MergeReadBufferBytes
The bytes each sorted run reads from the temp file per refill during the merge: 1 MiB by default, a multiple of 64 KiB. Shrunk, down to 64 KiB, when many runs share the budget.
public int MergeReadBufferBytes { get; set; }
Property Value
TempDirectory
The temp file's directory; null puts it in the database bundle, {bundle}/rebuild-tmp, on the data file's volume. When set, the rebuild works
in a subdirectory of it named after the database, {TempDirectory}/{bundle name}.rebuild-tmp.
public string TempDirectory { get; set; }
Property Value
Workers
The threads each phase of the rebuild may use: 0 (the default) for min(ProcessorCount, 8), else 1..64. Never more than one per 256 cache
pages, so the pages they all hold in flight stay a small part of the cache. One builds each tree; more than the archetype has trees helps only its
cluster walk.
public int Workers { get; set; }