Skip to content

[fix](be) Keep a requested constant value on a column reader cache hit - #68018

Open
LuciferYang wants to merge 2 commits into
apache:masterfrom
LuciferYang:fix/column-reader-cache-const-value
Open

LuciferYang wants to merge 2 commits into
apache:masterfrom
LuciferYang:fix/column-reader-cache-const-value

Conversation

@LuciferYang

@LuciferYang LuciferYang commented Sep 15, 2026

Copy link
Copy Markdown

What problem does this PR solve?

Issue Number: close #67994

Problem Summary:

__DORIS_COMMIT_TSO_COL__ stores a 0 placeholder on disk in a single-version segment, and the real value reaches readers by building a ConstantColumnReader instead of the on-disk one. That substitution goes through the per-segment reader cache, whose lookup drops the requested constant:

    if (auto cached = _lookup({col_uid, {}})) {
        *column_reader = cached;
        return Status::OK();
    }

So whichever caller populates the entry first decides what every later caller gets. The expression zone-map builders request a reader without a constant (be/src/storage/segment/segment.cpp:129-130, be/src/storage/segment/segment_iterator.cpp:3414-3415) and the segment-level one runs inside Segment::new_iterator (:485-488), before the SegmentIterator and therefore before any Segment::new_column_iterator call that would have installed the constant. Once the on-disk reader is cached, ConstantColumnReader::new_iterator is never reached and reads of that column return 0 as row data, not only as a zone map, until the entry or the segment is evicted.

That the mechanism is real is already recorded in the tree: segment_zone_maps_can_answer_agg walks every column with a bare request and skips exactly one ordinal, with the reason spelled out (be/src/storage/segment/segment.cpp:148-160): "Creating it here without one would cache a reader that hands every later read the on-disk placeholder instead."

This makes a request that carries a constant authoritative. On a hit, the cached reader is returned only when the caller asked for no constant, or when the cached reader is already a constant one; otherwise the constant reader is built and replaces the entry, so later callers that cannot supply the constant stop seeing the placeholder too. ColumnReader::is_constant() is the predicate the cache needs to tell the two apart.

Replacing an entry required fixing the insert path. _insert_locked_nocheck pushed a second LRU node for an existing key and overwrote only the map iterator, leaving the first node reachable through the list but not the map; eviction erases _cache_map[tail->key], so when that stale node reached the tail it erased the live entry of the same key while its node stayed in the list. It now updates the existing node in place.

Nothing here changes what the zone-map builders themselves request. A cache-level fix cannot repair an evaluation that already consumed the placeholder summary, so the builders still have to ask for the constant; that is #67995.

The concurrent case is deliberately left as last-writer-wins: two callers that both miss can both insert, and if the bare one lands last the entry holds the on-disk reader. The next request carrying a constant then falls through and replaces it, and the row-read path always carries one, so the state self-heals rather than needing a tie-break rule. I could not write a test that distinguishes a tie-break rule from its absence, so I did not add one.

One more change came out of review. Segment::new_index_iterator fetches the reader without a constant (be/src/storage/segment/segment.cpp:1069) and then calls reader->new_index_iterator (:1108), which was not virtual, so a constant reader ran the base implementation. That branches on the raw _type / _meta_type members, which ConstantColumnReader never sets, and ends in INVERTED_INDEX_NOT_SUPPORTED: a query on a column with an index would fail rather than return rows. ConstantColumnReader now overrides it and leaves the iterator unset, the same as the path that finds no reader at all, so the caller falls back to reading through this reader. That is the right answer independently of this bug, because the on-disk index for a placeholder column indexes the placeholder.

That failure does not need this PR: the predicate loop in Segment::new_iterator (:422-437) already installs the constant reader before SegmentIterator creates index iterators (be/src/storage/segment/segment_iterator.cpp:1853, :1885), so an indexed column reached this today. This PR adds one more ordering, where the expression zone-map builder warms the entry physically first.

Release note

Fixed a bug where a column whose stored value is a placeholder could be read back as that placeholder after another caller warmed the segment's column reader cache.

Check List (For Author)

  • Test
    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason

ConstValueIsNotDroppedOnCacheHit requests a reader without a constant, then with one, and asserts the second is a constant reader whose segment zone map is the degenerate non-null summary of that value; then that a following bare request gets the same constant reader, that the cache still holds one entry, and that asking again with a constant is a plain hit. Iterator output has its own coverage in constant_column_iterator_test.cpp.

SameKeyReplacementDoesNotLeaveAStaleLruNode replaces uid 1's entry, fills the cache past its capacity, and asserts uid 1 is gone from the reported readers and that the count matches the capacity.

Both were checked by mutation: serving the cached reader unconditionally makes the first test fail on is_constant(), and restoring the append-only insert makes the second fail on both assertions (uid 1 still reported, four entries instead of three).

NewIndexIteratorIsANoOp asserts that a constant reader returns OK and no iterator. Also mutation-checked: delegating the override to the base implementation makes it fail with [E-6002] Failed to load inverted index: index metadata is null.

The ordering the reviewer asked to cover, physical warm plus a hidden indexed column, needs a segment fixture carrying an inverted index on __DORIS_COMMIT_TSO_COL__, which I could not build; the override makes the reader itself refuse regardless of how it got there, and that part is covered.

Behavior changed:

  • No.
  • Yes.

A request carrying a constant now returns a constant reader even when the column is already cached, and the cached entry is replaced.

Does this need documentation?

  • No.

@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@LuciferYang

Copy link
Copy Markdown
Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 100.00% (2/2) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 63.03% (29322/46523)
Line Coverage 47.96% (305877/637801)
Region Coverage 43.60% (246860/566235)
Branch Coverage 45.14% (114707/254128)

@LuciferYang

Copy link
Copy Markdown
Author

/review

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (2/2) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 76.07% (34269/45051)
Line Coverage 60.97% (384417/630545)
Region Coverage 57.33% (323324/564001)
Branch Coverage 58.12% (147259/253357)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review result: changes requested (static review of head 2e7d6a02e4c7b78403c1304856e7ab0aa4c0df71).

One blocking correctness issue is reported inline: the new physical-to-constant cache upgrade can feed ConstantColumnReader into eager physical inverted-index initialization and turn a previously successful hidden commit-TSO query into an initialization error.

Critical checkpoints:

  • Goal, scope, and correctness: the focused cache suitability check fixes the reported physical-reader hit for ordinary row/segment-zone-map reads, and the same-key upsert fixes duplicate LRU nodes. It is not correct for the indexed continuation described inline.
  • Concurrency and lifecycle: cache map/list mutation is mutex-protected; splice preserves the stored iterator; returned shared_ptrs remain valid across replacement/eviction. Last-writer-wins construction creates no second distinct defect.
  • Configuration, compatibility, persistence, and writes: no new configuration, FE/BE field, RPC, serialized format, transaction/write/recovery behavior, or rolling-upgrade state is introduced.
  • Parallel and special paths: constant data and segment-zone-map consumers are correct; page-zone-map, bloom, and later predicate-pruning paths are conservative. The eager inverted-index consumer is the unsafe exception. The separately tracked placeholder zone-map-builder gap in #67995 was not duplicated.
  • Tests and results: the added unit tests distinguish the direct O-to-C cache fix and stale-LRU-node fix, but do not cover the physical-warm plus hidden-index continuation that exposes the inline issue. Per the review contract, no local build or tests were run. At this reviewed head, GitHub reports BE UT, COMPILE, P0, NonConcurrent, External Regression, Cloud regression, coverage, formatter, and style checks passed; performance remains pending. These are CI claims, not independent execution.
  • Observability and performance: cache counters remain internally consistent with resident-key lookup semantics, and the upsert remains O(1); no additional substantive metric or hot-path regression was found.
  • User focus: no additional review focus was supplied.

Review completion: complete after three bounded rounds. All candidates were independently verified and deduplicated; the accepted set is the single inline issue below, with no unresolved or capped finding.

// reader would hand back the placeholder both as row data and as a zone map. Fall through and
// build the constant reader, replacing the cached entry so later callers get the real value too.
if (auto cached = _lookup({col_uid, {}});
cached != nullptr && (!const_value.has_value() || cached->is_constant())) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Keep constant readers out of physical index initialization. With an inverted index on __DORIS_COMMIT_TSO_COL__, an OR such as tso < 10 OR tso > 20 remains a common expression, so segment expression-zone-map setup first caches the physical reader. This condition then replaces it with ConstantColumnReader during column-iterator setup; the following bare, eager index lookup receives that constant and calls non-virtual ColumnReader::new_index_iterator even though its physical type/index state was never initialized, so the query fails. This is new: for a real TSO greater than 20, both placeholder 0 and the real value satisfy the OR, so the pre-PR physical-warmed path returned the correct projected rows. Please skip physical index creation for constant readers or separate the cache entries, and cover this ordering in a test.

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 16974 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 2e7d6a02e4c7b78403c1304856e7ab0aa4c0df71, data reload: false

------ Round 1 ----------------------------------
============================================
q1	17584	3089	3073	3073
q2	2084	259	220	220
q3	10256	871	538	538
q4	4667	254	213	213
q5	7663	577	383	383
q6	136	115	93	93
q7	532	494	388	388
q8	9245	862	900	862
q9	3510	2381	2386	2381
q10	6515	847	741	741
q11	394	200	176	176
q12	612	260	197	197
q13	18128	1548	1160	1160
q14	158	151	135	135
q15	q16	442	399	373	373
q17	1369	851	740	740
q18	3096	2294	2243	2243
q19	1241	912	788	788
q20	398	292	200	200
q21	5636	1838	1874	1838
q22	332	272	232	232
Total cold run time: 93998 ms
Total hot run time: 16974 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3443	3386	3358	3358
q2	524	414	376	376
q3	2219	2409	2184	2184
q4	1203	1162	893	893
q5	2164	2119	2103	2103
q6	164	118	87	87
q7	1023	934	895	895
q8	1597	1401	1392	1392
q9	3135	3123	3084	3084
q10	1839	1796	1648	1648
q11	372	270	249	249
q12	459	429	347	347
q13	1462	1526	1183	1183
q14	170	173	155	155
q15	q16	393	402	361	361
q17	3582	3325	3341	3325
q18	4895	4401	4710	4401
q19	943	894	854	854
q20	1009	969	853	853
q21	3837	3262	3240	3240
q22	393	347	330	330
Total cold run time: 34826 ms
Total hot run time: 31318 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 82134 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 2e7d6a02e4c7b78403c1304856e7ab0aa4c0df71, data reload: false

query5	4230	420	329	329
query6	400	134	134	134
query7	4924	408	234	234
query8	288	126	115	115
query9	8680	2910	2914	2910
query10	391	228	187	187
query11	5386	1061	921	921
query12	125	76	68	68
query13	1192	460	330	330
query14	6097	2212	2065	2065
query14_1	1967	1957	1952	1952
query15	172	125	114	114
query16	923	345	347	345
query17	838	415	332	332
query18	2335	308	222	222
query19	158	129	101	101
query20	69	68	70	68
query21	201	99	86	86
query22	5411	5413	5445	5413
query23	6768	6149	6005	6005
query23_1	6139	6051	6197	6051
query24	7340	1093	777	777
query24_1	787	778	773	773
query25	418	268	223	223
query26	1239	247	128	128
query27	2769	405	256	256
query28	4698	1508	1517	1508
query29	922	412	336	336
query30	259	157	131	131
query31	849	399	329	329
query32	134	82	73	73
query33	453	208	169	169
query34	999	805	481	481
query35	397	408	347	347
query36	573	566	543	543
query37	128	78	69	69
query38	992	844	817	817
query39	508	498	475	475
query39_1	461	483	463	463
query40	199	89	101	89
query41	54	51	53	51
query42	72	72	73	72
query43	241	242	214	214
query44	992	539	560	539
query45	115	103	99	99
query46	777	852	539	539
query47	753	772	700	700
query48	306	292	236	236
query49	555	242	184	184
query50	715	252	192	192
query51	8241	8140	8146	8140
query52	73	65	58	58
query53	191	199	148	148
query54	214	168	142	142
query55	71	58	54	54
query56	184	163	164	163
query57	801	657	668	657
query58	212	179	168	168
query59	1228	1235	1106	1106
query60	253	184	170	170
query61	130	126	127	126
query62	371	226	176	176
query63	171	145	143	143
query64	2820	776	646	646
query65	1666	1587	1577	1577
query66	1883	327	201	201
query67	9970	9637	9604	9604
query68	2772	1176	764	764
query69	341	223	211	211
query70	685	609	621	609
query71	250	173	165	165
query72	2231	1645	1482	1482
query73	653	618	336	336
query74	1578	1229	1134	1134
query75	1161	1107	965	965
query76	2290	700	516	516
query77	261	250	208	208
query78	3973	3779	3302	3302
query79	2849	804	579	579
query80	1559	323	270	270
query81	540	154	130	130
query82	904	122	100	100
query83	278	211	197	197
query84	305	112	89	89
query85	832	320	266	266
query86	494	175	172	172
query87	1004	958	895	895
query88	2914	2119	2115	2115
query89	291	197	174	174
query90	2028	121	121	121
query91	130	116	96	96
query92	93	66	64	64
query93	1769	1149	718	718
query94	626	257	235	235
query95	513	312	226	226
query96	836	571	259	259
query97	1037	1050	1040	1040
query98	174	141	130	130
query99	431	342	308	308
Total cold run time: 179116 ms
Total hot run time: 82134 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 14.7 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 2e7d6a02e4c7b78403c1304856e7ab0aa4c0df71, data reload: false

query1	0.01	0.00	0.01
query2	0.08	0.04	0.04
query3	0.26	0.10	0.11
query4	1.60	0.11	0.10
query5	0.17	0.15	0.15
query6	1.24	0.71	0.67
query7	0.03	0.01	0.01
query8	0.05	0.03	0.03
query9	0.29	0.21	0.21
query10	0.35	0.35	0.34
query11	0.16	0.11	0.11
query12	0.15	0.12	0.13
query13	0.31	0.31	0.30
query14	0.45	0.44	0.44
query15	0.36	0.36	0.36
query16	0.23	0.22	0.23
query17	0.69	0.67	0.71
query18	0.18	0.17	0.17
query19	1.19	1.21	1.18
query20	0.02	0.01	0.01
query21	15.48	0.17	0.11
query22	5.09	0.04	0.05
query23	16.19	0.25	0.10
query24	3.01	0.32	0.25
query25	0.10	0.04	0.04
query26	0.81	0.18	0.11
query27	0.04	0.04	0.03
query28	3.67	0.51	0.27
query29	12.50	3.19	2.60
query30	0.26	0.12	0.13
query31	2.76	0.38	0.17
query32	3.58	0.32	0.25
query33	1.39	1.38	1.41
query34	15.38	2.24	1.78
query35	1.77	1.77	1.71
query36	0.46	0.30	0.29
query37	0.06	0.04	0.03
query38	0.05	0.03	0.03
query39	0.04	0.02	0.02
query40	0.11	0.08	0.08
query41	0.09	0.03	0.02
query42	0.04	0.02	0.02
query43	0.04	0.03	0.02
Total cold run time: 90.74 s
Total hot run time: 14.7 s

@LuciferYang

Copy link
Copy Markdown
Author

Fixed, with one correction to the framing.

The mechanism is real. Segment::new_index_iterator fetches the reader without a constant (be/src/storage/segment/segment.cpp:1069) and calls reader->new_index_iterator (:1108), which was not virtual; the base implementation branches on the raw _type / _meta_type members that ConstantColumnReader never sets, so it falls through to INVERTED_INDEX_NOT_SUPPORTED and the query fails.

It is not new to this PR, though. The predicate loop in Segment::new_iterator (:422-437) already installs the constant reader for that column before SegmentIterator creates index iterators (be/src/storage/segment/segment_iterator.cpp:1853, :1885), so an ordinary ColumnPredicate on an indexed __DORIS_COMMIT_TSO_COL__ reaches the same failure today. This PR adds one more ordering, the physically warmed one you describe.

I also could not confirm the premise that such an index can exist: processAddIndex resolves the column with olapTable.getColumn(col) and hands it to indexDef.checkColumn(...), and I found no visibility rejection on that path. So I treated it as plausible rather than proven and fixed it defensively.

The fix is on the reader rather than at the call site: new_index_iterator is now virtual and ConstantColumnReader overrides it to leave the iterator unset, exactly as the existing no-reader path does, so the caller falls back to reading through the constant. Two reasons for that placement. "I have no index" is knowledge the class has and each call site does not, and it also covers the pre-existing ordering above. It is unit-testable without a fixture: NewIndexIteratorIsANoOp, mutation-checked by delegating the override to the base, which fails with [E-6002] Failed to load inverted index: index metadata is null.

The full ordering test you asked for needs a segment carrying an inverted index on that hidden column, which I could not build. What I have instead is the reader refusing regardless of how it reached index setup.

ConstantColumnIteratorTest and ColumnReaderCacheTest are 26 for 26 locally, clang-format 16 clean.

@LuciferYang

Copy link
Copy Markdown
Author

run buildall

@LuciferYang

Copy link
Copy Markdown
Author

/review

@LuciferYang

Copy link
Copy Markdown
Author

run beut

@LuciferYang

Copy link
Copy Markdown
Author

run cloud_p0

@LuciferYang

Copy link
Copy Markdown
Author

run performance

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review result: changes requested (static review of exact head 3c7b4c426417d2f96beab15082a670fd7fc54d1b).

One blocking correctness issue is reported inline: the new same-key upsert allows an in-flight physical-reader miss to overwrite a completed constant-reader upgrade, so placeholder index or zone-map state can still drive filtering.

Critical checkpoints:

  • Goal and proof: the sequential physical-to-constant cache upgrade and constant-reader index dispatch are fixed and unit-covered, but the stated authoritative-constant behavior is not preserved under concurrent misses.
  • Scope: the four-file change is focused on reader polymorphism, cache replacement, and targeted BE unit tests.
  • Concurrency: map/list operations are mutex-protected, but lookup, construction, and upsert form a semantic lost-update race; this is the blocking P1. No additional lock-order or deadlock issue was found.
  • Lifecycle/static initialization: the non-null constant is the immutable commit TSO for one rowset/segment identity; reader/iterator ownership remains safe, with no cycle or cross-TU initialization issue.
  • Configuration: no configuration item is added or changed.
  • Compatibility/rolling upgrade: no wire, storage-format, RPC, or persisted-state change is introduced; the virtual dispatch change is internal to BE.
  • Parallel paths: stable fresh-null inverted/ANN fallback retains row evaluation correctly. Bare index and expression-zone-map consumers must observe the authoritative constant, which the accepted race can violate. The existing sequential index-dispatch thread is not duplicated.
  • Conditional checks: the new is_constant() condition explains and handles the sequential cases, but it does not define the concurrent winner at insertion.
  • Test coverage: sequential replacement, one-node LRU accounting, constant zone-map/type behavior, and direct index no-op are covered. A barrier-controlled mixed physical/constant miss test and authoritative-winner return assertion are missing.
  • Test results: no builds or tests were run locally because the review contract requires static-only review; no .out files apply.
  • Observability: cache gauges remain balanced; no additional required log or metric was identified.
  • Transaction/persistence: no EditLog, transaction, publish, or recovery data is changed.
  • Data writes/crash safety: no write path or on-disk mutation is modified.
  • Cross-layer variables: no new FE-BE variable or protocol field is introduced.
  • Performance/memory: replacement remains O(1), avoids duplicate LRU nodes, and adds no row-loop work or ownership leak.
  • Other issues: different-constant reuse and reused non-null index-output hypotheses were dismissed with call-path evidence; the separate bare placeholder zone-map issue is already tracked/fenced and was not duplicated.

User focus: no additional review focus was supplied.

Review completion: complete after two bounded rounds. The second normal and risk-focused reviews both returned NO_NEW_VALUABLE_FINDINGS; all candidates are accepted, dismissed with evidence, or duplicate-fenced. Accepted set: the single inline P1 below.

// Replacing an existing key updates its node in place. Pushing a second node for the same key
// would leave the first one unreachable in the list while eviction erases the map entry of
// whichever copy reaches the tail, dropping the live reader from the map.
if (auto it = _cache_map.find(key); it != _cache_map.end()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Preserve the constant reader across concurrent misses. _lookup releases _cache_mutex before construction, so a bare request can miss and start building the physical reader, a constant request can then insert and return its reader, and the first request reaches this branch last and overwrites it. Since a cached Segment is shared, a query that already created a ConstantColumnIterator can then do the bare index lookup and receive the placeholder's physical index; for example, real commit TSO 42 with tso > 20 can be eliminated by an index containing 0, with the predicate removed from row fallback. This is the inverse concurrent order from the existing sequential comment. Please make the compare-and-upsert constant-dominant regardless of arrival order, return the selected authoritative reader to the caller, and add a barrier-controlled mixed physical/constant miss test.

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (5/5) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 76.19% (34324/45052)
Line Coverage 60.99% (384584/630548)
Region Coverage 57.38% (323621/564002)
Branch Coverage 58.14% (147306/253357)

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 16923 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 3c7b4c426417d2f96beab15082a670fd7fc54d1b, data reload: false

------ Round 1 ----------------------------------
============================================
q1	17562	3028	3014	3014
q2	2108	260	225	225
q3	10230	894	528	528
q4	4668	253	198	198
q5	7693	564	387	387
q6	140	113	94	94
q7	532	497	393	393
q8	9237	852	896	852
q9	3443	2408	2449	2408
q10	6515	862	703	703
q11	400	197	175	175
q12	608	258	206	206
q13	18151	1562	1160	1160
q14	161	148	140	140
q15	q16	463	400	369	369
q17	1360	932	791	791
q18	3194	2335	2320	2320
q19	1277	918	752	752
q20	375	283	198	198
q21	5643	1775	1853	1775
q22	331	272	235	235
Total cold run time: 94091 ms
Total hot run time: 16923 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3393	3314	3281	3281
q2	517	386	380	380
q3	2304	2400	2287	2287
q4	1221	1196	904	904
q5	2256	2190	2178	2178
q6	165	119	86	86
q7	1049	932	855	855
q8	1587	1389	1393	1389
q9	3244	3225	3210	3210
q10	1932	1870	1684	1684
q11	360	275	263	263
q12	475	436	345	345
q13	1499	1548	1176	1176
q14	176	169	172	169
q15	q16	398	403	370	370
q17	3691	3391	3385	3385
q18	4994	4565	5176	4565
q19	944	868	859	859
q20	1064	999	840	840
q21	3948	3203	3253	3203
q22	405	347	324	324
Total cold run time: 35622 ms
Total hot run time: 31753 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 83555 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 3c7b4c426417d2f96beab15082a670fd7fc54d1b, data reload: false

query5	4249	434	335	335
query6	378	154	130	130
query7	4921	420	238	238
query8	295	125	118	118
query9	8683	2945	2965	2945
query10	411	239	190	190
query11	5374	1046	965	965
query12	122	75	75	75
query13	1197	456	324	324
query14	6121	2287	2156	2156
query14_1	2054	2024	2039	2024
query15	174	118	117	117
query16	911	377	346	346
query17	797	446	355	355
query18	2336	341	241	241
query19	167	137	104	104
query20	72	73	75	73
query21	204	101	87	87
query22	5538	5526	5567	5526
query23	6950	6496	6286	6286
query23_1	6408	6082	6395	6082
query24	7323	1087	767	767
query24_1	779	810	785	785
query25	423	273	240	240
query26	1237	232	129	129
query27	2782	427	260	260
query28	4698	1485	1497	1485
query29	906	425	333	333
query30	252	158	129	129
query31	812	400	339	339
query32	121	70	76	70
query33	454	219	170	170
query34	1004	853	462	462
query35	405	405	360	360
query36	571	546	568	546
query37	118	77	74	74
query38	1008	863	828	828
query39	487	497	465	465
query39_1	485	486	478	478
query40	195	90	77	77
query41	54	51	51	51
query42	73	69	71	69
query43	247	244	218	218
query44	1017	547	560	547
query45	112	102	101	101
query46	794	816	551	551
query47	759	783	712	712
query48	300	307	229	229
query49	534	243	184	184
query50	757	258	193	193
query51	7909	7909	8191	7909
query52	67	84	81	81
query53	196	200	145	145
query54	212	175	154	154
query55	74	60	62	60
query56	187	183	165	165
query57	710	683	670	670
query58	190	168	160	160
query59	1267	1279	1152	1152
query60	237	192	185	185
query61	114	109	111	109
query62	349	202	182	182
query63	168	160	156	156
query64	2755	835	661	661
query65	1681	1696	1639	1639
query66	1780	272	214	214
query67	9949	10176	10153	10153
query68	3040	1177	768	768
query69	350	234	191	191
query70	680	615	618	615
query71	254	185	175	175
query72	2262	1661	1525	1525
query73	663	588	318	318
query74	2007	1256	1193	1193
query75	1198	1107	970	970
query76	2376	725	526	526
query77	244	257	211	211
query78	4222	3817	3280	3280
query79	2659	920	604	604
query80	1552	328	265	265
query81	509	156	133	133
query82	657	124	101	101
query83	278	208	191	191
query84	296	108	87	87
query85	806	341	285	285
query86	475	188	204	188
query87	1051	997	943	943
query88	3276	2103	2120	2103
query89	281	199	178	178
query90	2170	140	122	122
query91	128	117	97	97
query92	99	72	71	71
query93	2952	1066	665	665
query94	667	271	213	213
query95	523	326	229	229
query96	795	590	272	272
query97	1123	1070	1039	1039
query98	181	137	133	133
query99	421	356	313	313
Total cold run time: 181536 ms
Total hot run time: 83555 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 14.75 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 3c7b4c426417d2f96beab15082a670fd7fc54d1b, data reload: false

query1	0.00	0.01	0.00
query2	0.08	0.04	0.04
query3	0.25	0.11	0.10
query4	1.60	0.10	0.09
query5	0.18	0.16	0.17
query6	1.26	0.71	0.67
query7	0.04	0.01	0.01
query8	0.04	0.03	0.03
query9	0.30	0.21	0.22
query10	0.36	0.35	0.34
query11	0.17	0.12	0.11
query12	0.15	0.12	0.12
query13	0.34	0.31	0.31
query14	0.47	0.46	0.46
query15	0.37	0.36	0.35
query16	0.23	0.22	0.22
query17	0.68	0.68	0.69
query18	0.18	0.16	0.17
query19	1.24	1.20	1.14
query20	0.01	0.02	0.01
query21	15.54	0.18	0.11
query22	5.10	0.05	0.04
query23	16.15	0.26	0.10
query24	3.00	0.32	0.24
query25	0.11	0.04	0.02
query26	0.77	0.17	0.12
query27	0.04	0.03	0.03
query28	3.60	0.56	0.27
query29	12.47	3.26	2.57
query30	0.26	0.11	0.11
query31	2.76	0.38	0.17
query32	3.51	0.33	0.23
query33	1.48	1.56	1.47
query34	15.35	2.23	1.82
query35	1.78	1.78	1.73
query36	0.46	0.30	0.29
query37	0.06	0.04	0.03
query38	0.04	0.03	0.03
query39	0.03	0.03	0.02
query40	0.12	0.08	0.08
query41	0.08	0.02	0.03
query42	0.04	0.02	0.02
query43	0.03	0.02	0.03
Total cold run time: 90.73 s
Total hot run time: 14.75 s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] The column reader cache drops a requested constant value on a cache hit, so a placeholder column can be read as its on-disk placeholder

2 participants