Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
5cfe911
[feature](be) Add SNII inverted index storage format
airborne12 Jun 26, 2026
39e9e52
[test](regression) Add SNII storage format regression
airborne12 Jun 27, 2026
4d5179e
[fix](be) Harden SNII inverted index integration
airborne12 Jun 27, 2026
94ee981
[improvement](be) Add inverted index IO profile metrics
airborne12 Jun 27, 2026
09e0c2a
[improvement](be) Optimize SNII phrase query candidate filtering
airborne12 Jun 27, 2026
6631a00
[improvement](be) Reduce SNII phrase query CPU
airborne12 Jun 27, 2026
59ea683
[improvement](be) Optimize SNII phrase query hot paths
airborne12 Jun 27, 2026
e0f6e25
[improvement](be) Optimize SNII inverted index query hot paths
airborne12 Jun 27, 2026
44011d0
[improvement](be) Optimize SNII phrase query CPU path
airborne12 Jun 27, 2026
7ee12ee
[improvement](be) Optimize SNII dense phrase conjunction
airborne12 Jun 27, 2026
74dd6c5
[improvement](be) Optimize SNII two-term phrase verification
airborne12 Jun 27, 2026
75fceb6
[improvement](be) Optimize SNII phrase CPU hotspots
airborne12 Jun 28, 2026
a1a6cf1
[improvement](be) Cache SNII logical index readers
airborne12 Jun 28, 2026
ebe7626
[improvement](be) Reduce SNII index remote read amplification
airborne12 Jun 28, 2026
7aed5e4
[improvement](be) Filter SNII phrase-prefix tail postings
airborne12 Jun 28, 2026
fbfa747
[improvement](be) Add SNII phrase bigram acceleration
airborne12 Jun 28, 2026
2f879c8
[refactor](be) Clarify ignored SNII format fields
airborne12 Jun 28, 2026
6487a58
[fix](be) Route SNII meta reads through file cache
airborne12 Jun 29, 2026
7145ef6
[doc](be) Add SNII perf-review and reuse-audit design docs + TDD plans
airborne12 Jun 29, 2026
4f3ab4e
[improvement](be) Reuse Doris crc32c thirdparty in SNII inverted index
airborne12 Jun 29, 2026
88e1532
[improvement](be) Drop SNII standalone S3 backend; route spill throug…
airborne12 Jun 29, 2026
76bd2e1
[test](be) Add SNII-core CLucene-decoupling guard test
airborne12 Jun 29, 2026
88006e9
[improvement](be) Reuse doris::Status in SNII inverted index
airborne12 Jun 29, 2026
3e55edb
[chore](be) Add ASF license headers to all SNII files
airborne12 Jun 29, 2026
61d06f4
[chore](be) Apply clang-format (v16) to SNII files
airborne12 Jun 29, 2026
a574398
[improvement](be) Remove SNII per-section profiling from general file…
airborne12 Jun 29, 2026
f2ca9f0
[improvement](be) Trim redundant SNII file-cache IO metrics to golden…
airborne12 Jun 29, 2026
8cc13e6
[improvement](be) Drop read_file_cache=false direct-read path from Ca…
airborne12 Jun 29, 2026
fcee125
[improvement](be) Remove SNII section-classification machinery from t…
airborne12 Jun 29, 2026
730725e
[fix](be) Drop to_doris_status leftover in inverted_index_file_reader…
airborne12 Jun 29, 2026
ac0c0d7
[test](be) Migrate SNII core unit tests into doris_be_test
airborne12 Jun 29, 2026
0249f3e
[improvement](be) SNII T19: uninitialized resize primitive for decode…
airborne12 Jun 29, 2026
c8c72c1
[improvement](be) SNII perf Batch 1: RE2 regexp, PRX single-batch, ad…
airborne12 Jun 30, 2026
1f630bf
[refactor](be) Relocate SNII to storage/index/snii + namespace doris:…
airborne12 Jun 30, 2026
b1a40d8
[improvement](be) SNII perf Batch 2: OR docid-union dedup, key-first …
airborne12 Jun 30, 2026
d1700b7
[improvement](be) Single-flight SNII inverted-index queries to dedup …
airborne12 Jun 30, 2026
393df3f
[improvement](be) Skip the SNII BSBF bloom when non-resident to cut c…
airborne12 Jun 30, 2026
68bea5e
[improvement](be) Skip the redundant SNII bootstrap-header read at se…
airborne12 Jun 30, 2026
ed7c26f
[fix](be) Apply clang-format v16 to SNII index-integration files
airborne12 Jun 30, 2026
b030b42
[chore](be) Remove SNII internal design/perf docs from the source tree
airborne12 Jun 30, 2026
947aeac
[improvement](be) SNII perf Batch 3: writer/build-path CPU and alloca…
airborne12 Jun 30, 2026
df43281
[improvement](be) SNII perf Batch 5: reader/encode micro-optimization…
airborne12 Jul 1, 2026
7dcc1ca
[improvement](be) SNII perf Batch 4 (T18): trim derivable FrqPrelude …
airborne12 Jul 1, 2026
93f2f83
[improvement](be) SNII G01: prune low-df phrase bigrams at flush, doc…
airborne12 Jul 2, 2026
d1cb9ba
[fix](be) SNII phrase-prefix: hidden bigram dict terms must not consu…
airborne12 Jul 2, 2026
17d7abb
[improvement](be) SNII G02: count-only fast path answers MATCH counts…
airborne12 Jul 2, 2026
7f14d90
[fix](be) SNII G02: fabricate null-disjoint count bitmap instead of v…
airborne12 Jul 2, 2026
c8bbfbb
[improvement](be) SNII G03: short-circuit COUNT_ON_INDEX row emission…
airborne12 Jul 2, 2026
3e76a4f
[improvement](be) SNII G04: bound bigram intern vocab (df==1 eviction…
airborne12 Jul 2, 2026
75b2660
[improvement](be) SNII G05: key phrase bigrams by (left_id,right_id) …
airborne12 Jul 2, 2026
4d98f23
[fix](be) SNII G05: gate per-pair seam counters under BE_TEST
airborne12 Jul 2, 2026
c26e219
[improvement](be) SNII G06: sink the bigram df gate into the SPIMI drain
airborne12 Jul 3, 2026
2e52aef
[improvement](be) SNII G08+G09: accurate SPIMI resident accounting an…
airborne12 Jul 3, 2026
9ef7cb6
[fix](be) SNII G09b: harden the global writer limiter against forced-…
airborne12 Jul 3, 2026
0d93a05
[improvement](be) SNII G10: flat-hash the unigram intern set
airborne12 Jul 3, 2026
8532ea4
Revert "[improvement](be) SNII G10: flat-hash the unigram intern set"
airborne12 Jul 3, 2026
920c8e6
[fix](be) SNII G09: default the global writer memory limiter to OFF
airborne12 Jul 3, 2026
fb34415
[improvement](be) SNII G11: writer cache locality - pair-map/slot pre…
airborne12 Jul 3, 2026
ccaa508
[improvement](be) SNII cold-open meta diet (G13): zstd sti/dbd meta s…
airborne12 Jul 3, 2026
e1c66d7
[improvement](be) SNII bigram max-df prune (G15): drop near-ubiquitou…
airborne12 Jul 3, 2026
630a2da
[improvement](be) SNII: raise bigram max-df prune default ratio to 0.25
airborne12 Jul 4, 2026
74cd6eb
[improvement](be) SNII G16-a: drop freq region from prune-mode window…
airborne12 Jul 4, 2026
624b928
[improvement](be) SNII G16-b: per-index section-byte accounting
airborne12 Jul 4, 2026
7d372b6
[improvement](be) SNII G16-c: drop freq layout on non-scoring positio…
airborne12 Jul 4, 2026
c6dbe70
[improvement](be) SNII G16-d: dict block size experiment knob
airborne12 Jul 4, 2026
7578817
[improvement](be) SNII G16-e: large windows for docs-only bigram post…
airborne12 Jul 4, 2026
6ed4ff5
[improvement](be) SNII G16-f: elide dict-entry ttf/max_freq stats on …
airborne12 Jul 4, 2026
77a2499
[improvement](be) SNII G16-g: exact bsbf sizing (drop power-of-2 roun…
airborne12 Jul 4, 2026
bdf4567
[improvement](be) SNII G16-h: tunable zstd levels for dict blocks and…
airborne12 Jul 4, 2026
4475769
[improvement](be) SNII G16-i: zstd on docs-only bigram dd regions + r…
airborne12 Jul 5, 2026
cded122
[improvement](be) SNII: cut phrase-prefix CPU/IO via merged tail veri…
airborne12 Jul 5, 2026
3d88960
[improvement](be) SNII: bigram fast path for single-leading-term phra…
airborne12 Jul 5, 2026
16873a4
[improvement](be) SNII: prefilter multi-word phrase-prefix by tail-un…
airborne12 Jul 5, 2026
8d50539
[improvement](be) SNII: skip non-selected docs' position varints in C…
airborne12 Jul 5, 2026
52e9726
[improvement](be) SNII inline position-delta decode for phrase queries
airborne12 Jul 7, 2026
878fee1
[improvement](be) add inverted-index read bypass-file-cache diagnosti…
airborne12 Jul 7, 2026
d422395
[fix](be) SNII: geometric bulk growth for null-docid and docid-sink a…
airborne12 Jul 11, 2026
8752a2f
[improvement](be) SNII: defer hidden phrase-bigram build to compactio…
airborne12 Jul 11, 2026
6832cba
[improvement](be) SNII: default all zstd levels to 3, add direct-load…
airborne12 Jul 11, 2026
621d0c3
[improvement](be) SNII: stream analyzer tokens straight into the SPIM…
airborne12 Jul 11, 2026
3517055
[chore](be) SNII: clang-format drift in dict_block/dict_entry
airborne12 Jul 11, 2026
0de2803
[chore](be) SNII: clang-format fixes for T-C/T1a hunks
airborne12 Jul 11, 2026
9a0dc08
[fix](be) SNII: rebase integration fixes for segment_iterator on master
airborne12 Jul 11, 2026
40bc652
[improvement](be) SNII: default bigram defer-to-compaction to ON
airborne12 Jul 11, 2026
c35daaa
[fix](build) Restore build script from origin/master
airborne12 Jul 12, 2026
0828706
[fix](be) Close SNII writer during begin close
airborne12 Jul 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions be/src/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1298,6 +1298,89 @@ DEFINE_mDouble(inverted_index_ram_buffer_size, "512");
// -1 indicates not working.
// Normally we should not change this, it's useful for testing.
DEFINE_mInt32(inverted_index_max_buffered_docs, "-1");
// SNII phrase-bigram df-prune threshold: <0 auto (max(64, doc_count/10000)),
// 0 disable min-df pruning (full legacy layout ALSO needs
// snii_bigram_prune_max_df_ratio outside (0, 1)), >0 fixed min-df.
DEFINE_mInt32(snii_bigram_prune_min_df, "-1");
// SNII phrase-bigram df-prune UPPER bound, as a fraction of the segment doc
// count (G15): pairs whose final df exceeds ratio * doc_count are pruned from
// the hidden bigram dict (their 2-term phrase queries fall back to the
// positions path, same as min-df pruning); only a ratio in (0, 1) arms the
// gate (<= 0 disables; >= 1 can never prune, so it resolves to no gate).
// 0.25 keeps the 20-25% df band on the bigram fastpath (bench: "united
// states" sits at 21.2% df in wikipedia; pruning it costs a 2.7x cold-phrase
// cliff, keeping the whole band costs +0.85% table size on textbench).
DEFINE_mDouble(snii_bigram_prune_max_df_ratio, "0.25");
// Defer the SNII hidden phrase-bigram build to compaction (default ON since
// the 4-corpus write-parity campaign: import index CPU -3.5%..-35% at zero
// compaction overhead; fresh segments answer phrases through the identical-
// results positions fallback until compaction rebuilds the bigrams).
// Full behavioral contract documented at the DECLARE in config.h (single
// source of truth: deferral scope, capture-once semantics, segcompaction
// caveat, and the never-compacted perf-cliff disclosure).
DEFINE_mBool(snii_bigram_defer_build_to_compaction, "true");
// DIAGNOSTIC (default off): force SNII inverted-index reads onto NO_CACHE
// (precise S3 range GETs) instead of the 1MiB FILE_BLOCK_CACHE. Per-open on the
// SNII reader only -- does NOT touch global enable_file_cache, so cloud mode
// still boots. Measures the block-cache read amplification's true cost. Warm
// queries lose the local cache under this flag, so it is a measurement knob, not
// a production setting.
DEFINE_mBool(inverted_index_read_bypass_file_cache, "false");
// G16-c: whether plain positions-tier (non-scoring) SNII indexes lay out freq
// regions. Freq bytes serve ONLY BM25 scoring, which the Doris integration
// does not reach yet (scoring_query has no production caller), so the default
// drops them (textbench: -2.2 GB index). Scoring-config indexes always write
// freq regardless. Applies at segment build (write side only); existing
// segments keep whatever layout they were written with (self-describing).
DEFINE_mBool(snii_positions_index_write_freq, "false");
// G16-h: zstd levels for the SNII dict-block compression and the .prx window
// auto mode. Level 9 (vs the historical 3) shrinks the two largest compressed
// sections -- textbench: index -457 MB (0.918x -> 0.891x V3) -- for an import
// CPU cost inside the run-to-run variance band; zstd decode speed does not
// depend on the level, and warm/cold benches measured no query change.
// Write side only; segments self-describe their compression.
// Default 3 since the all-level-3 evaluation (2026-07-11, 4 corpora): vs
// level 9 the settled index grows only +0.6%..+6.3% (whole table
// +0.3%..+1.9%) while import index CPU drops 17-24% and full-compaction CPU
// 8-24%; settled cold-query latency is unchanged (interleaved A/B). The
// delta+varint-encoded payloads are high-entropy, so level 9's extra search
// buys almost no ratio. Raise only for size-critical deployments.
DEFINE_mInt32(snii_dict_block_zstd_level, "3");
DEFINE_mInt32(snii_prx_zstd_level, "3");
// Patch C prx tiering: zstd level for the prx region of DIRECT-LOAD segments
// only (stream/broker load, see IndexColumnWriter::set_direct_load). Inert at
// the defaults (both levels 3); it exists for size-critical deployments that
// RAISE snii_prx_zstd_level (e.g. 9) and still want cheap loads: compaction
// rewrites every segment at snii_prx_zstd_level, so SETTLED data (and the
// cold-query path over it) is unaffected by the load tier -- measured -290s
// (httplogs) / -204s (agentlogs) of import index CPU at 3 vs 9. Same clamp
// [3, 19]. Read at index flush like snii_prx_zstd_level (a mid-load change
// lands on in-flight segments); the direct-load BIT itself is captured once.
DEFINE_mInt32(snii_prx_zstd_level_direct_load, "3");
// G16-d: target SNII dict block size in bytes; 0 uses the format default
// (64 KiB). Larger blocks compress better under the per-block zstd (the dict
// is the dominant physical section on high-cardinality corpora) at the cost
// of a larger fetch+decompress unit per cold dict-block miss. Write side
// only; the block size is self-described by the on-disk directory.
DEFINE_mInt32(snii_target_dict_block_bytes, "0");
// SNII per-writer bigram intern-vocabulary cap (bytes): df==1 bigram terms are
// incrementally evicted (and bloom-recorded for the flush-time drop) once the
// live bigram intern storage crosses this. 0 = uncapped. Effective only when
// snii_bigram_prune_min_df != 0. Default 512 MiB.
DEFINE_mInt64(snii_bigram_vocab_cap_bytes, "536870912");
// Process-wide SNII index-build RAM budget across ALL live segment writers
// (G09); the largest writers are asked to spill early once the sum crosses it.
// 0 disables. Default 8 GiB.
DEFINE_mInt64(snii_index_writer_global_memory_bytes, "0");
// Minimum reclaimable posting-arena bytes before a G09 forced spill is honored
// (and before a writer is eligible as a spill victim): forced spills reclaim
// ONLY the arena, so smaller triggers cut tiny runs for near-zero relief.
// Default 64 MiB.
DEFINE_mInt64(snii_forced_spill_min_arena_bytes, "67108864");
// Max spill-run files one SNII writer accumulates before its runs are
// merge-compacted into one (bounds the k-way merge fan-in and its open fds;
// every run is held open for the whole merge). 0 = uncapped. Default 64.
DEFINE_mInt32(snii_spill_max_run_files_per_buffer, "64");
// dict path for chinese analyzer
DEFINE_String(inverted_index_dict_path, "${DORIS_HOME}/dict");
DEFINE_Int32(inverted_index_read_buffer_size, "4096");
Expand Down
124 changes: 124 additions & 0 deletions be/src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,130 @@ DECLARE_Int32(ann_index_result_cache_stale_sweep_time_sec);
// inverted index
DECLARE_mDouble(inverted_index_ram_buffer_size);
DECLARE_mInt32(inverted_index_max_buffered_docs);
// SNII phrase-bigram df-prune threshold (G01 "bigram diet"). Hidden adjacent-pair
// bigram terms whose final segment df is below the effective threshold are not
// materialized (their 2-term phrases fall back to positions verification), and
// surviving bigram postings are written docs+freq only (no positions).
// < 0 : auto -- max(64, segment_doc_count / 10000) per segment (default)
// = 0 : disable MIN-df pruning. NOTE (G15): the full legacy layout (every
// bigram materialized with positions, dict miss == "no adjacency")
// additionally requires snii_bigram_prune_max_df_ratio to resolve to
// no gate; with the default ratio the upper gate stays active.
// > 0 : use this fixed min-df threshold
DECLARE_mInt32(snii_bigram_prune_min_df);
// SNII phrase-bigram df-prune UPPER bound (G15), as a fraction of the segment
// doc count. A hidden adjacent-pair bigram term whose FINAL segment df exceeds
// ratio * segment_doc_count is pruned from the bigram dict at flush --
// near-ubiquitous (stopword-like) pairs pay dict + posting bytes for almost no
// selectivity -- and its 2-term phrase queries fall back to the generic
// positions-verification path, exactly like min-df-pruned pairs (the reader
// falls back on any bigram dict miss once the meta declares either gate). The
// resolved absolute threshold is floored at 2 * effective min-df when the
// min-df gate is active, so the two gates never overlap; it is applied only at
// flush, where the final df and final doc count are both known (a partial
// mid-feed df can never prove the final df will exceed a doc-count-scaled
// bound). Only a ratio in (0, 1) arms the gate: <= 0 disables it, and >= 1
// resolves to no gate too (df never exceeds the doc count, so such a bound
// could never prune -- recording it would only arm pointless dict-miss
// fallbacks).
DECLARE_mDouble(snii_bigram_prune_max_df_ratio);
// Defer the SNII hidden phrase-bigram build to compaction. When true, a direct
// non-ARRAY load (stream/broker load, DataWriteType::TYPE_DIRECT) skips feeding
// the hidden adjacent-pair bigram tokens AND the bigram sentinel term entirely
// -- measured at ~3/4 of the SNII import-index CPU gap vs V3 -- and persists a
// resident capability flag, so phrase queries on such a fresh segment skip
// impossible pair probes before taking the full-fidelity positions-verification
// fallback (results are identical, only slower) until compaction rewrites the
// segment. The omitted sentinel retains the existing fallback for older readers.
// ARRAY indexes keep the full build to preserve existing SNII full-build phrase
// behavior at element boundaries.
// Compaction re-feeds every token through the same writer with a
// non-TYPE_DIRECT write type, so it rebuilds the bigram index with zero extra
// mechanism; schema change and ADD INDEX builds likewise keep the full build.
// Captured once per index writer when the segment writer marks it direct-load
// (before any row is fed); a mid-load flip does not change an in-flight
// segment. NOTE: local-mode segcompaction (enable_segcompaction) rewrites
// merged segments as TYPE_COMPACTION during the load itself, so those segments
// still build the full bigram inside the load window -- the deferral saving
// applies only to segments that are not segcompacted; cloud mode has no
// segcompaction, so the saving is complete there.
// PERF-CLIFF DISCLOSURE (default is ON): compaction is the ONLY mechanism
// that rebuilds a deferred segment's bigrams, and nothing guarantees it ever
// runs -- a load-once-then-cold tablet (single rowset under the cumulative
// thresholds, compaction disabled, or policies that skip a lone rowset) keeps
// its phrase queries on the positions-verification path indefinitely (results
// identical, slower), and BUILD INDEX cannot rebuild an already-existing
// index. DISABLE this on deployments whose compaction policy cannot cover
// lone-load rowsets (until the deferred-rowset compaction backstop lands).
DECLARE_mBool(snii_bigram_defer_build_to_compaction);
// DIAGNOSTIC: force SNII inverted-index reads to bypass the 1MiB FILE_BLOCK_CACHE
// and issue precise S3 range GETs (NO_CACHE) instead. Applies ONLY to the SNII
// index file reader (per-open cache_type), NOT the global enable_file_cache, so
// cloud mode does not FATAL. Default false (keep block cache). Used to measure
// whether the block-cache read amplification hurts cold reads at the cost of
// re-reading S3 on every (warm) query. Not for production: warm loses the local
// cache. Read-side only.
DECLARE_mBool(inverted_index_read_bypass_file_cache);
// G16-c: whether plain positions-tier (non-scoring) SNII indexes lay out freq
// regions. Freq serves ONLY BM25 scoring (no production caller yet), so the
// default (false) drops the layout; scoring-config indexes always keep freq.
// Write-side only; segments are self-describing either way.
DECLARE_mBool(snii_positions_index_write_freq);
// G16-h: zstd levels for SNII dict blocks / prx windows. Default 3 (the
// all-level-3 evaluation showed level 9 buys <=6.3% index size for 17-24%
// import CPU; see the DEFINEs in config.cpp).
DECLARE_mInt32(snii_dict_block_zstd_level);
DECLARE_mInt32(snii_prx_zstd_level);
// Patch C: prx zstd level for DIRECT-LOAD segments only (default 3, cheaper
// import); compaction rewrites at snii_prx_zstd_level so settled segments are
// unaffected. Full contract at the DEFINE in config.cpp.
DECLARE_mInt32(snii_prx_zstd_level_direct_load);
// G16-d: target SNII dict block size in bytes; 0 = format default (64 KiB).
// Bigger blocks -> better per-block zstd on the dict region, larger cold
// fetch+decompress unit per dict-block miss. Write side only.
DECLARE_mInt32(snii_target_dict_block_bytes);
// SNII phrase-bigram vocabulary cap in bytes, PER index writer (G04 "bigram
// diet" phase 2). The SPIMI intern table otherwise accumulates every distinct
// hidden bigram string for the whole segment (the dominant import RSS
// overshoot on long-document corpora). When the live bigram intern storage
// (strings + fixed per-term overhead) crosses this cap, bigram terms whose
// current df == 1 (the Zipf long tail) are incrementally EVICTED from the
// intern table and postings buffer and recorded in an ever-dropped bloom; at
// flush any bigram in the bloom is dropped IN ADDITION to the df threshold
// (safe: a dropped bigram's 2-term phrase falls back to positions
// verification per the G01 reader contract). Only takes effect when bigram
// pruning is enabled (snii_bigram_prune_min_df != 0); 0 disables the cap
// (unbounded vocabulary, pre-G04 behavior).
DECLARE_mInt64(snii_bigram_vocab_cap_bytes);
// PROCESS-WIDE budget in bytes for SNII index-build RAM, summed across every
// live SNII segment writer of the BE (all tablets x all concurrent loads; G09).
// The per-writer cap (inverted_index_ram_buffer_size) bounds ONE writer, but a
// concurrent load keeps (tablets x concurrency) writers alive at once, none of
// which may ever reach its own cap -- their SUM is what this bounds. When the
// registered total exceeds the budget, the LARGEST writers are asked to spill
// their posting buffers to disk early (async-safe advisory requests, honored
// on each writer's own thread; output stays byte-identical). 0 disables the
// global limiter (per-writer spilling only). Checked at index-writer creation:
// a change applies to writers created afterwards.
DECLARE_mInt64(snii_index_writer_global_memory_bytes);
// G09 forced-spill floor: minimum reclaimable posting-arena bytes a SNII
// writer must hold before a process-wide forced-spill request is honored, and
// before the global limiter selects it as a spill victim. A forced spill
// reclaims ONLY the posting arena -- the persistent vocab / pair-map
// structures survive it -- so honoring below a real floor degenerates into a
// storm of tiny runs whenever the budget is dominated by persistent bytes
// (each run then costs a file, a sort and a merge-fd for near-zero memory
// relief). The global budget therefore bounds SPILLABLE memory, not
// persistent memory. Default 64 MiB.
DECLARE_mInt64(snii_forced_spill_min_arena_bytes);
// G09 run-file cap: maximum spill-run files one SNII writer may accumulate;
// on the next spill past the cap, the existing runs are merge-compacted into
// a single run first (term stream unchanged). Bounds the final k-way merge's
// fan-in and, decisively, its simultaneously-open file descriptors -- every
// run of a buffer is reopened and held open for the whole merge, so unbounded
// run counts across ~100 concurrent writers can exhaust the BE nofile rlimit
// ("Too many open files" at run reopen). 0 disables the cap. Default 64.
DECLARE_mInt32(snii_spill_max_run_files_per_buffer);
// dict path for chinese analyzer
DECLARE_String(inverted_index_dict_path);
DECLARE_Int32(inverted_index_read_buffer_size);
Expand Down
1 change: 1 addition & 0 deletions be/src/common/status.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ namespace ErrorCode {
E(INVERTED_INDEX_COMPACTION_ERROR, -6010, false); \
E(INVERTED_INDEX_ANALYZER_ERROR, -6011, false); \
E(INVERTED_INDEX_FILE_CORRUPTED, -6012, false); \
E(INVERTED_INDEX_SNII_NOT_FOUND, -6013, false); \
E(KEY_NOT_FOUND, -7000, false); \
E(KEY_ALREADY_EXISTS, -7001, false); \
E(ENTRY_NOT_FOUND, -7002, false); \
Expand Down
5 changes: 4 additions & 1 deletion be/src/exec/scan/olap_scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ static bool has_file_cache_statistics(const io::FileCacheStatistics& stats) {
stats.inverted_index_bytes_read_from_remote != 0 ||
stats.inverted_index_bytes_read_from_peer != 0 ||
stats.inverted_index_local_io_timer != 0 || stats.inverted_index_remote_io_timer != 0 ||
stats.inverted_index_peer_io_timer != 0 || stats.inverted_index_io_timer != 0;
stats.inverted_index_peer_io_timer != 0 || stats.inverted_index_io_timer != 0 ||
stats.inverted_index_request_bytes != 0 || stats.inverted_index_read_bytes != 0 ||
stats.inverted_index_range_read_count != 0 ||
stats.inverted_index_serial_read_rounds != 0;
}

Status OlapScanner::_prepare_impl() {
Expand Down
Loading
Loading