Skip to content

Query condition cache for the Memory engine - #123798

Merged
alexey-milovidov merged 31 commits into
masterfrom
memory-query-condition-cache
Oct 15, 2026
Merged

alexey-milovidov merged 31 commits into
masterfrom
memory-query-condition-cache

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

The query condition cache (use_query_condition_cache) for the Memory engine.

This PR includes the commits of #123788 (lazy materialization), because both change ReadFromMemoryStorageStep. The TopN filtering of #123787 is already merged into master.

An entry describes one block of a Memory table, split into granules of 8192 rows. It records the granules where no row satisfies a condition, and the source skips such blocks and granules without evaluating the condition on them. There are two kinds of entries:

  • PREWHERE, which the Memory source evaluates itself. The source writes these entries only when nothing else removed rows before PREWHERE: not a row policy, not the TopN threshold.
  • The filter of the query pushed down to the read (filter_actions_dag), with the same key as for MergeTree. The FilterTransform of the WHERE filter writes these entries, using the MarkRangesInfo that the source attaches to its chunks when it has removed no rows itself. updateQueryConditionCache tags the filter step only if just row-preserving expression steps lie between it and the read (no arrayJoin).

FilterTransform previously recorded only chunks that were filtered out completely, which is useless with Memory's ~65k–83k-row blocks. The new MarkRangesInfo::rows_per_mark declares that the chunk holds the rows of its marks in order, with a fixed number of rows per mark. With it, FilterTransform also records the granules without matches of a partially filtered chunk. MergeTree doesn't set it, so nothing changes there. My first attempt, splitting every block into per-granule chunks, made WHERE AdvEngineID <> 0 3x slower.

Stale entries: a block is identified by the table UUID, a generation of the table data, and the block's number within the generation. Appending blocks and dropping the oldest ones (max_rows_to_keep and friends) keep the generation and advance the numbers. Any other change of the data (a mutation, TRUNCATE) constructs a new BlocksWithCounts, which takes a new generation. The test 05322_memory_query_condition_cache covers these cases, and I checked that it fails if the block numbering ignores removed blocks.

ClickBench on a local 10M-row subset of hits, single thread, best of 5, cache off → on:

query compress = true uncompressed
Q20 WHERE UserID = 435090932899640449 0.028 → 0.002 s 0.009 → 0.002 s
Q21 count() WHERE URL LIKE '%google%' 0.330 → 0.273 s 0.079 → 0.044 s
Q22 URL LIKE '%google%' AND SearchPhrase <> '' 0.373 → 0.062 s 0.078 → 0.011 s
Q23 0.829 → 0.687 s 0.174 → 0.112 s
Q24 SELECT * ... URL LIKE '%google%' ORDER BY EventTime LIMIT 10 0.370 → 0.319 s 0.045 → 0.029 s

Q2 and Q8 are unchanged, and the other queries show no overhead. With all three PRs together, compared with master on the same machine and 16 threads, Q22 and Q24 are about 3x faster, and the geometric mean of the 43 queries is 0.96.

Limitation: with compress = true, a block decompresses each column as a whole, so skipping granules inside a block saves only the evaluation of the condition, not the decompression. Q21 and Q24 are bound by decompressing URL. Getting MergeTree's times on them would need Memory to compress columns in chunks of about 1 MB that can be decompressed separately. Simply storing smaller blocks doubles the memory (5.2 GB instead of 2.6 GB of compressed data for 8192-row blocks).

Related: #123787
Related: #123788
Related: ClickHouse/ClickBench#1590

Changelog category (leave one):

  • Performance Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

The query condition cache works for Memory tables: the granules of 8192 rows where no row satisfies the condition of a query are recorded, and later queries with the same condition skip them.

🤖 Generated with Claude Code


Workflow [PR]
Sync PR [sync-upstream/pr/123798]

Version info

  • Merged into: 26.11.1.13-master (included in 26.11 and later)

alexey-milovidov and others added 3 commits October 3, 2026 23:58
For `ORDER BY ... LIMIT n` over a `Memory` table, the columns that are not
needed for filtering and sorting are now read only for the `n` rows that
survive the `LIMIT`, like for `MergeTree`, Parquet files and object storage.

The main read produces `__global_row_index`, the number of the row in the
storage snapshot, which both branches share. The lazy branch reads the rows
block by block; with `compress = true` every block decompresses each
deferred column as a whole, so the blocks are split into contiguous ranges
read by parallel sources, whose chunks are passed on in order.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
An entry describes one block of the table, split into granules of 8192 rows,
and records the granules where no row satisfies a condition. The source skips
such blocks and granules. There are two kinds of entries:

- PREWHERE, which the source evaluates itself. The source writes the entries
  when nothing else (a row policy, the TopN threshold) has removed rows before
  PREWHERE.
- The filter of the query pushed down to the read, with the same key as for
  `MergeTree`. The `FilterTransform` of the `WHERE` filter writes the entries
  from the `MarkRangesInfo` of the chunks, which the source attaches when it
  has removed no rows itself. The new `MarkRangesInfo::rows_per_mark` lets
  `FilterTransform` also record the granules without matches of a partially
  filtered chunk.

A block is identified by a generation of the table data and its number in the
generation. Appending blocks and removing the oldest ones (`max_rows_to_keep`)
keep the generation; any other change of the data (a mutation, `TRUNCATE`)
starts a new one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [d958f80]

Summary: ✅


AI Review

Summary

Adds query condition caching and lazy materialization for Memory tables. Six focused stateless regression tests pass on the current PR binary, but a reproduced lambda predicate hash collision still causes incorrect results and blocks approval.

Findings

❌ Blockers

  • ReadFromMemoryStorageStep.cpp:991, also line 1175: different lambda bodies must have different cache identities. FunctionCapture still omits its body from the hash used here, so predicates with the same capture signature can reuse incompatible granule masks. Reproduced on the d958f808 binary: warming the AND predicate below makes the OR predicate return 8192, whereas disabling the cache returns 1000000. Both predicates must return the same result with caching enabled or disabled.

    SET use_query_condition_cache = 1, optimize_move_to_prewhere = 0, max_threads = 1;
    CREATE TABLE t (a Nullable(Int256), b UInt64) ENGINE = Memory;
    INSERT INTO t SELECT number, number FROM numbers(1000000)
        SETTINGS max_block_size = 100000;
    SELECT count() FROM t WHERE arrayExists(x -> ((x = a) AND (x = 4242)), [b]);
    SELECT count() FROM t WHERE arrayExists(x -> ((x = a) AND (x = 4242)), [b]);
    SELECT count() FROM t WHERE arrayExists(x -> ((x = a) OR (x = 4242)), [b]);
    SELECT count() FROM t WHERE arrayExists(x -> ((x = a) OR (x = 4242)), [b])
        SETTINGS use_query_condition_cache = 0;

    Incorporate the lambda hashing fix from Fix wrong results of the query condition cache for lambdas that capture a column #122966 before enabling this cache for Memory, and cover both WHERE and PREWHERE reuse with a focused regression test. Already tracked in the existing inline thread.

Final Verdict

Status: ❌ Block. Incorporate the predicate hashing fix and verify that different lambda bodies cannot share cached exclusions through either Memory cache path.

@clickhouse-gh clickhouse-gh Bot added pr-performance Pull request with some performance improvements comp-simple-engines Lightweight single-node table engines: Log/StripeLog (append-only logs), Buffer (async batching),... labels Oct 4, 2026
@clickhouse-gh

clickhouse-gh Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

📊 Cloud Performance Report

✅ AI verdict: no_change — no significant changes across 31 queries analysed

This PR adds lazy materialization and query condition cache support for the Memory table engine. Outside the Memory read step, the only changes are an extra type check in the lazy-materialization and query-condition-cache plan optimizations, so MergeTree query plans are unchanged. The only two flagged results are ClickBench Q33 (-14.1%) and Q34 (-13.1%). Both are filter-free GROUP BY aggregations on the MergeTree hits table, have noisy histories, and have source medians inside master's recent range, so both are downgraded to not sure. Neither benchmark reads from Memory tables, so this run shows no performance effect from the PR, either positive or negative.

clickbench

⚠️ 2 inconclusive

Flagged queries (2 of 43)
Query Verdict Baseline median (ms) PR median (ms) Change q-value Hint
⚠️ 33 not_sure 1127 968 -14.1% <0.0001 aggregation: Q33 is a GROUP BY over the MergeTree hits table with no WHERE, and the PR only changes Memory-engine reads, so the -14.1% cannot come from this diff. The source median sits inside master's recent range and this query's history is noisy.
⚠️ 34 not_sure 1123 976 -13.1% <0.0001 aggregation: Q34 is a GROUP BY URL over MergeTree with no filter, so the Memory-engine read changes in this PR never run for it. The -13.1% sits inside master's recent range on a query with a noisy history.

Change = percent below ×2; the ratio of medians (×N faster/slower) beyond, where percent understates the scale. q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on.

tpch_adapted_1_official

🟢 No significant changes

Debug info
  • StressHouse run: 5ad79bc4-179e-4f4a-8fda-7e823441a4eb
  • MIRAI run: 6ccadfc2-b1d7-4b89-bcf5-14f999bc9b2a
  • PR check IDs:
    • clickbench_32282_1791925414
    • clickbench_32311_1791925416
    • clickbench_32541_1791925467
    • tpch_adapted_1_official_32644_1791925471
    • tpch_adapted_1_official_33620_1791925791
    • tpch_adapted_1_official_33728_1791925797

alexey-milovidov and others added 7 commits October 5, 2026 09:57
For a query like `SELECT json FROM t ORDER BY rowNumberInAllBlocks() LIMIT 2`, all
columns are deferred to the lazy branch and the main branch reads only
`__global_row_index`; `StorageSnapshot::check` rejected the empty list of columns
with `EMPTY_LIST_OF_COLUMNS_QUERIED`. Skip the check in that case, the source
already produces chunks with only the global row index.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=123788&sha=807d3dfd0b145cef508c02cb63a93d7e4b7fc6bc&name_0=PR&name_1=Fast%20test
PR: #123788

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…` column

The mask of the rows passing the `PREWHERE` steps is taken from the filter column
as is, so for `PREWHERE k` over a `UInt8` column it holds the values of `k`, not
only 0 and 1. The writer of the cache searched for the byte 1 and recorded the
granules whose passing rows had other values as having no matches, so the next
query with the same condition returned no rows. Check for any non-zero byte.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=123798&sha=c8036a384db97af5266d2948262b8820ab612a9b&name_0=PR&name_1=Fast%20test
PR: #123798

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…of insert parallelism

`05289_memory_prewhere_multiple_steps` compares the bytes read with one and with
several `PREWHERE` steps. The benefit of the steps is in the block where the first
condition removes all rows, and the query condition cache skips that block in both
queries, so disable the cache there.

`05321_memory_lazy_materialization` orders by `rowNumberInAllBlocks`, which follows
the order of the blocks. A parallel `INSERT ... SELECT FROM numbers` can store them
in a different order, so insert with a single thread.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=123798&sha=c8036a384db97af5266d2948262b8820ab612a9b&name_0=PR&name_1=Fast%20test
PR: #123798

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing d958f808e with master f90aebc48 (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of 78a2e26b7; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Object file sizes

10 object files changed (+226.04 KiB total), 0 added.

Object file Master PR Δ
src/CMakeFiles/dbms.dir/Processors/QueryPlan/ReadFromMemoryStorageStep.cpp.o 304.21 KiB 487.48 KiB +183.27 KiB (+60.24%)
src/CMakeFiles/dbms.dir/Processors/Transforms/FilterTransform.cpp.o 131.26 KiB 160.90 KiB +29.64 KiB (+22.58%)

719 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only clickhouse-bundle) and not compared.

Compile time of recompiled translation units

479 translation units recompiled, 4699 s compile time in total, 479 of them have a recent master baseline.

Job report

alexey-milovidov and others added 3 commits October 6, 2026 05:50
…`WHERE`

`FilterStep` evaluates a conjunction by a chain of `FilterTransform`s, one per atom,
all with the same key of the query condition cache. The atoms after the first one
got the chunks of a `Memory` table with `MarkRangesInfo::rows_per_mark` set, although
the previous atoms had already removed rows, and threw the `LOGICAL_ERROR`
"The chunk with N rows does not consist of M marks of 8192 rows for the query condition cache".

Now a `FilterTransform` that removes some rows of a chunk clears `rows_per_mark` in a copy
of its `MarkRangesInfo`. Recording a whole chunk without matches stays as it was: the rows
removed before are removed by the other atoms of the same condition.

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=123798&sha=ea7a69562089a32962e96b922ac732279f5c5a62&name_0=PR&name_1=Stateless%20tests%20%28arm_asan_ubsan%2C%20targeted%29
#123798

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…AULT` column

`Memory` does not evaluate the default expression for the blocks inserted before
`ALTER TABLE ADD COLUMN`: the query itself sees the default of the type there, which is
the same value the in-source TopN filter compares, so the filter is correct for such a
column. Pin it with a test comparing the results with and without the filter.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
alexey-milovidov and others added 2 commits October 6, 2026 22:29
…ped by the filter entry

The source of a `Memory` table starts from the granules allowed by both the `PREWHERE` entry and
the entry of the filter pushed down to the read. The granules skipped by the latter were never
evaluated by `PREWHERE`, but were recorded as having no rows satisfying it, so a later query with
the same `PREWHERE` could miss rows. Skip those granules when writing the `PREWHERE` entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	tests/queries/0_stateless/04077_materialized_cte_union.sql
#	tests/queries/0_stateless/05320_memory_top_k_dynamic_filter.reference
#	tests/queries/0_stateless/05320_memory_top_k_dynamic_filter.sql
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=123798&sha=63301ba67e515b2ab98c35f56fe09c97f0ebb768&name_0=PR&name_1=Performance%20Comparison%20%28amd_release%2C%20master_head%2C%205%2F6%29 (adaptive_codec_merge query #0, OPTIMIZE TABLE ... FINAL on MergeTree with enable_adaptive_codec_selection, +23%) and provide a fix in a separate PR. This PR only touches reads from the Memory engine, so the merge path is not affected by it; the branch was behind master, which has since changed the adaptive codec code, so master is now merged in. If the fix is already in progress, link it here.

@groeneai

groeneai commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Acknowledged. I'm investigating the adaptive_codec_merge #0 slowdown; I'll follow up here with a PR (or my findings).

Preliminary data (query_metrics_v2, amd, client_time) points to a per-build effect rather than a code change or the stale base: since 2026-10-06 some master builds are about 20% slower on this query on whichever side of a comparison they run, while the next master build (same code plus one merge) is fast again:

  • 47a31cdf6f: 0.707 s as new vs 0.592 s, then 0.690 s as old vs 0.570 s
  • 1200a74131: 0.704 s as new vs 0.572 s, then 0.771 s as old vs 0.631 s
  • 12e23c6549: 0.670 s as new vs 0.561 s, then 0.776 s and 0.696 s as old vs 0.641 s and 0.586 s

This run is the same shape (reference 756552d661 0.606 s, PR build 0.745 s), and 5 PRs hit it in the last two days. Next step is to profile a slow and a fast master build on this query to find which code is that layout-sensitive.

@groeneai

groeneai commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Fix: #124741 (test-only, one line in tests/performance/adaptive_codec_merge.xml).

The slow runs come from code layout, not from a code change. The fixture data has an exact 8 KiB period, so each 64 KiB block is one ~56 KiB LZ4 match and the merge is dominated by LZ4's LZ4_count loop. Its machine code is identical in the 9 official master builds I measured, but in 3 of them (47a31cdf6f, 1200a74131, 12e23c6549) the CPU front end runs it at about half speed: same instruction count, 2x the cycles in LZ4_compress_fast_extState. A plain LZ4 merge without adaptive selection shows the same slow mode.

The PR changes the data to repeat each of 1024 random hashes 8 times. LZ4 still wins every block, and all 9 builds land within 3% of the median (0.56-0.58 s). Both sides of the comparison use the PR's checked-out XML, so this PR picks it up with the next master merge after it lands.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 @groeneai, thanks for tracing the AST fuzzer mismatch to the lambda key in the query condition cache. #122966 fixes it, and this PR will pick it up with a master merge after that one lands.

Pushed 71e4f21:

@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 The only red check, Stateless tests (arm_asan_ubsan, azure, sequential), is the job-level timeout (9000 s, killed at test 1175 / 1181 with no test failures): https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=123798&sha=71e4f21027af002edd346f3142035ff000eedee4&name_0=PR&name_1=Stateless%20tests%20(arm_asan_ubsan%2C%20azure%2C%20sequential)

It is unrelated to this PR: the same job times out for 80+ PRs per day since 2026-10-09, and the slowest tests in this run are 03988_cached_read_big_at, 03393_max_merge_delayed_streams_for_parallel_write, 03100_lwu_57_lock_acquire_timeout. Fixes in progress:
Related: #123849
Related: #125010
Related: #125007
Related: #125004

The branch was merged with master on 2026-10-10; there are no unresolved review threads.

alexey-milovidov and others added 3 commits October 11, 2026 15:54
…ion-cache

Resolve the conflict in `ReadFromMemoryStorageStep.cpp`: `master` added
filling of missing `Nested` members with the array sizes of their siblings
(`findSizesSource`, `fillColumnsMissingFromBlock`) as members of
`MemorySource`. They are moved to free functions taking `nested_arrays`, so
that the lazy branch of lazy materialization
(`LazyReadFromMemoryBlocksSource`) fills missing columns the same way.
…terialization of `Memory`

Co-Authored-By: Claude Opus 5.5 <[email protected]>
alexey-milovidov and others added 3 commits October 12, 2026 12:32
…cache of `Memory` as read

The granules that the query condition cache eliminates are never scanned, so reporting them
in the progress made them count against `max_rows_to_read`, `read_overflow_mode = 'break'`
and `READ_ROWS` quotas, letting `use_query_condition_cache` change the result of a query.
Report only the scanned rows, as `MergeTree` does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…re not counted as read

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=123798&sha=latest&name_0=PR&name_1=Stateless%20tests%20(arm_binary%2C%20ParallelReplicas%2C%20s3%20storage%2C%20parallel) (05350_comparison_tuple_elimination_shared_alias, NOT_FOUND_COLUMN_IN_BLOCK through Remote) and provide a fix in a separate PR. If the fix is already in progress, link it here. It looks like #125195 may cover it. The 05238_pretty_squash_broken_pipe failure in the arm_darwin fast test is fixed in master by #125102, which this branch now includes.

@groeneai

Copy link
Copy Markdown
Collaborator

Yes, #125195 is the fix for this one. The error is byte-identical (query 14, Not found column not(and(equals(__table1.n, __table1.n), equals(1_UInt8, 2_UInt8)))).

ComparisonTupleEliminationPass builds and(equals(n, n), equals(1, 2)) unfolded on the initiator, while the replica analyzes the shipped query again, folds it to a constant and names it with an unqualified n. It fails only when the remote replica (not the local one) reads the single mark, about 1 in 130 runs, and it has hit 8 PRs (this one included) since the test was added yesterday. The PR adds remote() queries that fail deterministically on master. Its CI is green and it is waiting for review.

… row-set-dependent filters

The granules skipped by the query condition cache are removed before `PREWHERE` and the row
policy run. If either of them has a stateful or non-deterministic function, such as
`rowNumberInBlock` or `blockSize`, it sees a different set of rows, and a warmed cache changes
the result: e.g. `PREWHERE rowNumberInBlock() = 1 WHERE k = 8192` matches `k = 8192` after the
first granule is skipped. Do not consult or write the cache for such queries, the same as the
top-K filter is not used for them.

#123798 (comment)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=123798&sha=735aeea6d79fcc5dc76707db8a1295176f953006&name_0=PR&name_1=Integration%20tests%20%28arm_binary%2C%201%2F4%29 (test_storage_iceberg_concurrent/test_concurrent_reads.py::test_concurrent_reads, FILE_DOESNT_EXIST: the metadata file for the Iceberg table does not exist) and provide a fix in a separate PR. It has failed 25 times on master since 2026-10-12 and in many unrelated PRs. If the fix is already in progress, link it here.

@groeneai

Copy link
Copy Markdown
Collaborator

This is fixed by #125448 (mine), merged 2026-10-13 01:47 UTC. This run tested 735aeea merged into master b137629 (2026-10-12 22:29 UTC), which does not contain the fix.

It is the #125448 mechanism: test_storage_delta/test_writes_interop.py ran earlier on the same xdist worker gw0, and test_concurrent_reads then reused that Spark JVM with a stale cached s3a:// filesystem bound to the other module's MinIO.

All 25 master failures since 2026-10-12 are on 22 commits without the fix. The 22 master commits that contain it have 108 passing runs of this test and no failures. The 20 PR failures since the merge all come from workflows dispatched before it (the latest at 01:42 UTC), so they tested a master without the fix.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Thanks @groeneai. I merged master (now containing #125448) into the branch as 682247a. That restarts CI: the previous run failed only through infrastructure, with build jobs ending in error waiting for container: unexpected EOF and jobs that never started. The open thread on lambda hashing still waits for #122966, which has not been merged yet.

alexey-milovidov and others added 2 commits October 14, 2026 21:30
…ndition cache key

An `ALTER` of the columns keeps the stored blocks and their generation, but can change
the values read from them: a `Nested` subcolumn missing in the blocks takes its array sizes
from the stored siblings, and the read casts to the changed type (e.g. `JSON(SKIP a)`).
Hash the columns of the metadata snapshot of the query into the block identity, so an
entry is used only with the same columns it was written with, including by in-flight readers.

#123798 (comment)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov alexey-milovidov self-assigned this Oct 15, 2026

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

All good.

@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 15, 2026
Merged via the queue into master with commit 1966cce Oct 15, 2026
179 checks passed
@alexey-milovidov
alexey-milovidov deleted the memory-query-condition-cache branch October 15, 2026 23:59
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-simple-engines Lightweight single-node table engines: Log/StripeLog (append-only logs), Buffer (async batching),... pr-performance Pull request with some performance improvements pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants