Skip to content

Re-land exact row filtering for vector search rescoring queries - #108846

Merged
shankar-iyer merged 11 commits into
ClickHouse:masterfrom
skuznetsov:codex/reland-vector-rescoring-row-filter
Jul 19, 2026
Merged

shankar-iyer merged 11 commits into
ClickHouse:masterfrom
skuznetsov:codex/reland-vector-rescoring-row-filter

Conversation

@skuznetsov

@skuznetsov skuznetsov commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

Related: #105591
Related: #108423
Related: #108812

Re-land #105591 on top of the _distance guard from #108423.

The previous merge was reverted by #108812 because the old test coverage expected explicit _distance selection to work. This version keeps _distance internal, removes the conflicting direct-selection expectations, and preserves the row-level vector-index candidate filter for vector_search_with_rescoring = 1.

For vector_search_with_rescoring = 1, exact rescoring is restricted to rows returned by vector-index candidate selection. It no longer brute-force rescores neighbouring rows from the same MergeTree granule when those rows were not returned by the vector index.

Changelog category (leave one):

  • Performance Improvement

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

Vector search queries using rescoring now restrict exact distance calculation to vector-index candidate rows instead of brute-force rescoring neighbouring rows from the same MergeTree granule.

Version info

  • Merged into: 26.7.1.1181 (included in 26.7 and later)

@shankar-iyer shankar-iyer self-assigned this Jun 30, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [dcce702]

Summary: ✅


AI Review

Summary

This PR re-lands row-level candidate filtering for vector-search rescoring, updates the vector_search_with_rescoring documentation, and adds focused regression coverage for FINAL, lazy materialization, PREWHERE eligibility, and lightweight deletes. The earlier correctness regressions raised on this PR are fixed in the current code, but the branch still changes the result semantics of an existing setting without a compatibility path, so I do not think it is ready to merge as-is.

Findings

❌ Blockers

  • [src/Core/Settings.cpp:7931-7939, tests/queries/0_stateless/02354_vector_search_rescoring_and_prewhere.reference:27-34] [dismissed by author -- https://github.com/Re-land exact row filtering for vector search rescoring queries #108846#discussion_r3517318722] The PR turns vector_search_with_rescoring = 1 into a different result-selection algorithm: the updated references now drop rows 18 and 17, and the setting text documents candidate-only rescoring as the new behavior. Because vector_search_with_rescoring is already a shipped setting, this changes query results after upgrade with no compatibility / SettingsChangesHistory.cpp route to preserve the prior semantics. vector_search_index_fetch_multiplier is not an equivalent escape hatch: it can fetch more approximate candidates, but it cannot reproduce the old "rescore every row in the candidate granules" behavior when the eventual exact winner was never returned by the index.
    Suggested fix: gate the new semantics behind a compatibility/default setting, or record the change in SettingsChangesHistory.cpp with a compatibility switch that preserves the previous rescoring mode.
Final Verdict

❌ Changes required until the existing-setting behavior change has an explicit compatibility path.

@clickhouse-gh clickhouse-gh Bot added the pr-performance Pull request with some performance improvements label Jun 30, 2026
@skuznetsov-clickhouse skuznetsov-clickhouse added can be tested Allows running workflows for external contributors CI for issues found in CI labels Jul 1, 2026
 may add PK-overlapping ranges after vector index analysis via . The rescoring row filter only has row offsets for the original vector candidates, so applying it before the final merge can drop rows added by exact-mode recovery and let an older  row survive.

Keep mark-level vector index selection and exact-mode range recovery, but do not enable  for rescoring queries with . Non- rescoring still uses the candidate-row filter.

Add a  regression case to  where the reference query and vector-index query must both return the newer visible row after .

Related: ClickHouse#108846

Tested locally:

- env -u CFLAGS -u CXXFLAGS -u LDFLAGS -u CMAKE_C_FLAGS -u CMAKE_CXX_FLAGS -u CMAKE_EXE_LINKER_FLAGS -u CMAKE_SHARED_LINKER_FLAGS -u CMAKE_MODULE_LINKER_FLAGS ninja -C build_verify programs/clickhouse

- tests/clickhouse-test -b build_verify/programs/clickhouse --queries tests/queries --no-stateful --no-random-settings --no-random-merge-tree-settings --no-zookeeper --no-shard --timeout 180 02354_vector_search_rescoring 02354_vector_search_rescoring_distance_in_select_list 02354_vector_search_rescoring_and_prewhere 02354_vector_search_incident1654

- build_verify/programs/clickhouse client --multiquery < tmp/pr108846_final_probe4.sql
@skuznetsov

Copy link
Copy Markdown
Contributor Author

The FINAL blocker was valid. I pushed c687159 with a targeted fix and regression coverage.

What changed:

  • useVectorSearch.cpp: the row-level rescoring candidate filter is not enabled for queries with FINAL. Mark-level vector index selection and exact-mode range recovery are still used.
  • 02354_vector_search_rescoring: added a ReplacingMergeTree regression where the original vector candidate is an older row and exact-mode FINAL recovery must keep the newer same-PK row.

Local verification:

  • ninja -C build_verify programs/clickhouse
  • tests/clickhouse-test -b build_verify/programs/clickhouse --queries tests/queries --no-stateful --no-random-settings --no-random-merge-tree-settings --no-zookeeper --no-shard --timeout 180 02354_vector_search_rescoring 02354_vector_search_rescoring_distance_in_select_list 02354_vector_search_rescoring_and_prewhere 02354_vector_search_incident1654
  • Manual repro now returns 2\t1\t[0.1,0] for both the reference query and the vector-index FINAL query, while trace still exercises the problematic path: vector index drops 4/6 granules and findPKRangesForFinalAfterSkipIndex adds 3 ranges.

The reland stores `use_vector_search_result_filter` in shared read hints. `prepared_index` reuses the main `data_part_info_for_read`, and `MergeTreeReadTask::createReaders` also builds non-main readers for index and PREWHERE stages. If those readers interpret the rescoring flag, they can build and apply the same row-offset filter before the final data reader.

Gate the rescoring row filter on `main_reader` in `MergeTreeRangeReader::fillVirtualColumns` and `MergeTreeRangeReader::executePrewhereActionsAndFilterColumns`. Keep the existing `_distance` path unchanged so vector index reads that explicitly request `_distance` still populate and apply the virtual-column filter.

Review thread: ClickHouse#108846 (comment)

Local verification:

- `ninja -C build_verify programs/clickhouse`

- `tests/clickhouse-test -b build_verify/programs/clickhouse --queries tests/queries --no-stateful --no-random-settings --no-random-merge-tree-settings --no-zookeeper --no-shard --timeout 180 02354_vector_search_rescoring 02354_vector_search_rescoring_distance_in_select_list 02354_vector_search_rescoring_and_prewhere 02354_vector_search_lazy_materialization 02354_vector_search_incident1654`
Add a focused stateless test for the multi-reader topology from the review thread: vector-search rescoring with lazy materialization enabled and a selected mark that contains spillover rows beyond the top-k candidates.

The test verifies that the plan uses `LazilyReadFromMergeTree`, that the vector similarity index is used, and that late materialization of an extra payload column returns the expected candidate rows under `vector_search_with_rescoring = 1`.

Review thread: ClickHouse#108846 (comment)

Local verification:

- `tests/clickhouse-test -b build_verify/programs/clickhouse --queries tests/queries --no-stateful --no-random-settings --no-random-merge-tree-settings --no-zookeeper --no-shard --timeout 180 04489_vector_search_rescoring_lazy_materialization`

- `tests/clickhouse-test -b build_verify/programs/clickhouse --queries tests/queries --no-stateful --no-random-settings --no-random-merge-tree-settings --no-zookeeper --no-shard --timeout 180 02354_vector_search_rescoring 02354_vector_search_rescoring_distance_in_select_list 02354_vector_search_rescoring_and_prewhere 02354_vector_search_lazy_materialization 02354_vector_search_incident1654 04489_vector_search_rescoring_lazy_materialization`
 used  as a proxy for vector second-pass execution. That proxy is too broad: rescoring queries can later skip the candidate-row filter, for example when PK pruning leaves a non-empty read range without vector-search row hints, so implicit  was disabled without any vector-search replacement benefit.

Make the suppression depend on the read-hint conditions that the second pass needs: local index analysis, non- rescoring reads, vector-search result hints for rescoring, and distance-bearing hints for the non-rescoring  rewrite.

Add  to cover both sides: PK-pruned rescoring restores implicit , while an eligible rescoring query still suppresses it for the row-filter path.

Review thread: ClickHouse#108846 (comment)

Verification:

- ninja -C build_verify programs/clickhouse

- tests/clickhouse-test --binary build_verify/programs/clickhouse --testname 04490_vector_search_rescoring_prewhere_eligibility

- tests/clickhouse-test --binary build_verify/programs/clickhouse --testname 02354_vector_search_rescoring 02354_vector_search_rescoring_and_prewhere 02354_vector_search_rescoring_distance_in_select_list 02354_vector_search_lazy_materialization 02354_vector_search_incident1654 04489_vector_search_rescoring_lazy_materialization 04490_vector_search_rescoring_prewhere_eligibility

- git diff --check
`optimizePrewhere` now suppresses implicit `PREWHERE` only when read hints make the vector second pass eligible, but non-rescoring vector search has one additional upper-plan rejection: the `_distance` rewrite is disabled when the query still needs the physical vector column in the output.

When the second pass reaches such a late rejection and no vector optimization is applied, run `optimizePrewhere` once for the filter node with vector suppression disabled. Keep this gated by `query_plan_optimize_prewhere` through `Optimization::ExtraSettings`, so the fallback does not move conditions when the query-plan `PREWHERE` optimization is disabled.

Extend `04490_vector_search_rescoring_prewhere_eligibility` with both sides of that late-rejection case: selecting `vec` restores implicit `PREWHERE`, while `query_plan_optimize_prewhere = 0` keeps it disabled.

Verification:
- `ninja -C build_verify programs/clickhouse`
- `tests/clickhouse-test --binary build_verify/programs/clickhouse --testname 04490_vector_search_rescoring_prewhere_eligibility`
- `tests/clickhouse-test --binary build_verify/programs/clickhouse --testname 02354_vector_search_rescoring 02354_vector_search_rescoring_and_prewhere 02354_vector_search_rescoring_distance_in_select_list 02354_vector_search_lazy_materialization 02354_vector_search_incident1654 04489_vector_search_rescoring_lazy_materialization 04490_vector_search_rescoring_prewhere_eligibility`
- `git diff --check`
After gating implicit `PREWHERE` suppression on actual vector second-pass eligibility, indexed auto/postfilter queries in `02354_vector_search_nonindexed_columns` no longer keep the `WHERE` predicate as a plain filter when the PK filter leaves no usable vector row hints. The second pass does not apply the vector rewrite in that shape, so implicit `PREWHERE` is restored.

Update the reference and test comment to match the new intended behavior.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=108846&sha=f254dac3784c858c9287cba471f5ebf6a44cd9f8&name_0=PR&name_1=Stateless%20tests%20%28arm_asan_ubsan%2C%20targeted%29
PR: ClickHouse#108846

Verification:
- `tests/clickhouse-test --binary build_verify/programs/clickhouse --testname 02354_vector_search_nonindexed_columns`
- `tests/clickhouse-test --binary build_verify/programs/clickhouse --testname 02354_vector_search_nonindexed_columns 02354_vector_search_rescoring 02354_vector_search_rescoring_and_prewhere 02354_vector_search_rescoring_distance_in_select_list 02354_vector_search_lazy_materialization 02354_vector_search_incident1654 04489_vector_search_rescoring_lazy_materialization 04490_vector_search_rescoring_prewhere_eligibility`
- `git diff --check`
`part_offsets_filter_for_vector_search` is built over physical rows in the current granules. When an earlier filter such as lightweight delete has already been applied, `ReadResult::num_rows` is smaller than `total_rows_per_granule`, while `final_filter` still keeps the physical row shape.

Passing the physical vector filter directly to `ReadResult::optimize` either skipped candidate-row filtering with the old `num_rows` gate or violated `applyFilter` size invariants when the gate was widened. Convert the vector filter through `final_filter` before calling `optimize` in that state, matching the existing `combineFilters` contract for already-applied filters.

Add a lightweight-delete regression test that asserts rescoring does not return a surviving granule mate outside vector candidates. Also make `02354_vector_search_nonindexed_columns` assert that indexed `auto`/`postfilter` paths still use the vector index even when implicit `PREWHERE` is restored.

Tests:
- `env -u CFLAGS -u CXXFLAGS -u LDFLAGS -u CPPFLAGS ninja -C build_verify programs/clickhouse`
- `tests/clickhouse-test --binary build_verify/programs/clickhouse --testname 04491_vector_search_rescoring_lightweight_delete_filter`
- `tests/clickhouse-test --binary build_verify/programs/clickhouse --testname 02354_vector_search_nonindexed_columns`
- `tests/clickhouse-test --binary build_verify/programs/clickhouse --testname 04491_vector_search_rescoring_lightweight_delete_filter 02354_vector_search_rescoring 04490_vector_search_rescoring_prewhere_eligibility 02354_vector_search_nonindexed_columns 04489_vector_search_rescoring_lazy_materialization 02354_vector_search_rescoring_and_prewhere 02354_vector_search_rescoring_distance_in_select_list 02354_vector_search_lazy_materialization 02354_vector_search_incident1654`
- `git diff --check -- src/Storages/MergeTree/MergeTreeRangeReader.cpp tests/queries/0_stateless/02354_vector_search_nonindexed_columns.sql tests/queries/0_stateless/02354_vector_search_nonindexed_columns.reference tests/queries/0_stateless/04491_vector_search_rescoring_lightweight_delete_filter.sql tests/queries/0_stateless/04491_vector_search_rescoring_lightweight_delete_filter.reference`
Comment thread src/Core/Settings.cpp Resolved
@clickhouse-gh

clickhouse-gh Bot commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

📊 Cloud Performance Report

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

This change is entirely scoped to vector-similarity search rescoring: it rewrites the PREWHERE/vector-index second-pass optimizer and the MergeTree row-filter path, all gated on a query actually using a vector_similarity index. ClickBench Q15 and Q32 use no vector index, so neither flagged delta can be attributed to this PR. The deterministic envelope correctly held Q15's -13.1% at no_change as run-to-run variance, and Q32's -5.7% is borderline and off-path; both readings are consistent with the diff. No real performance impact is expected from this change on these benchmarks.

clickbench

⚠️ 1 inconclusive

Flagged queries (1 of 43)
Query Verdict Baseline median (ms) PR median (ms) Change q-value Hint
⚠️ 32 not_sure 1331 1255 -5.7% <0.0001 Borderline delta with mixed signals from the two tests. Q32 does not use a vector index, so this change cannot touch its execution path; not_sure is appropriate.

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: 94a64d03-04de-4f55-b105-67a57d4c7607
  • MIRAI run: b6343f57-0c28-4cf5-b650-88b25392a9fb
  • PR check IDs:
    • clickbench_222295_1784387446
    • clickbench_222309_1784387446
    • clickbench_222315_1784387446
    • tpch_adapted_1_official_222321_1784387446
    • tpch_adapted_1_official_222332_1784387446
    • tpch_adapted_1_official_222365_1784387446

@clickhouse-gh

clickhouse-gh Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 86.10% 86.10% +0.00%
Functions 91.80% 91.80% +0.00%
Branches 78.20% 78.20% +0.00%

Changed lines: Changed C/C++ lines covered: 153/167 (91.62%) · Uncovered code

Full report · Diff report

@shankar-iyer

Copy link
Copy Markdown
Member

Green CI at dcce702

@shankar-iyer
shankar-iyer added this pull request to the merge queue Jul 19, 2026
Merged via the queue into ClickHouse:master with commit cca0b66 Jul 19, 2026
179 checks passed
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 19, 2026
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
 may add PK-overlapping ranges after vector index analysis via . The rescoring row filter only has row offsets for the original vector candidates, so applying it before the final merge can drop rows added by exact-mode recovery and let an older  row survive.

Keep mark-level vector index selection and exact-mode range recovery, but do not enable  for rescoring queries with . Non- rescoring still uses the candidate-row filter.

Add a  regression case to  where the reference query and vector-index query must both return the newer visible row after .

Related: ClickHouse#108846

Tested locally:

- env -u CFLAGS -u CXXFLAGS -u LDFLAGS -u CMAKE_C_FLAGS -u CMAKE_CXX_FLAGS -u CMAKE_EXE_LINKER_FLAGS -u CMAKE_SHARED_LINKER_FLAGS -u CMAKE_MODULE_LINKER_FLAGS ninja -C build_verify programs/clickhouse

- tests/clickhouse-test -b build_verify/programs/clickhouse --queries tests/queries --no-stateful --no-random-settings --no-random-merge-tree-settings --no-zookeeper --no-shard --timeout 180 02354_vector_search_rescoring 02354_vector_search_rescoring_distance_in_select_list 02354_vector_search_rescoring_and_prewhere 02354_vector_search_incident1654

- build_verify/programs/clickhouse client --multiquery < tmp/pr108846_final_probe4.sql
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
The reland stores `use_vector_search_result_filter` in shared read hints. `prepared_index` reuses the main `data_part_info_for_read`, and `MergeTreeReadTask::createReaders` also builds non-main readers for index and PREWHERE stages. If those readers interpret the rescoring flag, they can build and apply the same row-offset filter before the final data reader.

Gate the rescoring row filter on `main_reader` in `MergeTreeRangeReader::fillVirtualColumns` and `MergeTreeRangeReader::executePrewhereActionsAndFilterColumns`. Keep the existing `_distance` path unchanged so vector index reads that explicitly request `_distance` still populate and apply the virtual-column filter.

Review thread: ClickHouse#108846 (comment)

Local verification:

- `ninja -C build_verify programs/clickhouse`

- `tests/clickhouse-test -b build_verify/programs/clickhouse --queries tests/queries --no-stateful --no-random-settings --no-random-merge-tree-settings --no-zookeeper --no-shard --timeout 180 02354_vector_search_rescoring 02354_vector_search_rescoring_distance_in_select_list 02354_vector_search_rescoring_and_prewhere 02354_vector_search_lazy_materialization 02354_vector_search_incident1654`
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
Add a focused stateless test for the multi-reader topology from the review thread: vector-search rescoring with lazy materialization enabled and a selected mark that contains spillover rows beyond the top-k candidates.

The test verifies that the plan uses `LazilyReadFromMergeTree`, that the vector similarity index is used, and that late materialization of an extra payload column returns the expected candidate rows under `vector_search_with_rescoring = 1`.

Review thread: ClickHouse#108846 (comment)

Local verification:

- `tests/clickhouse-test -b build_verify/programs/clickhouse --queries tests/queries --no-stateful --no-random-settings --no-random-merge-tree-settings --no-zookeeper --no-shard --timeout 180 04489_vector_search_rescoring_lazy_materialization`

- `tests/clickhouse-test -b build_verify/programs/clickhouse --queries tests/queries --no-stateful --no-random-settings --no-random-merge-tree-settings --no-zookeeper --no-shard --timeout 180 02354_vector_search_rescoring 02354_vector_search_rescoring_distance_in_select_list 02354_vector_search_rescoring_and_prewhere 02354_vector_search_lazy_materialization 02354_vector_search_incident1654 04489_vector_search_rescoring_lazy_materialization`
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
 used  as a proxy for vector second-pass execution. That proxy is too broad: rescoring queries can later skip the candidate-row filter, for example when PK pruning leaves a non-empty read range without vector-search row hints, so implicit  was disabled without any vector-search replacement benefit.

Make the suppression depend on the read-hint conditions that the second pass needs: local index analysis, non- rescoring reads, vector-search result hints for rescoring, and distance-bearing hints for the non-rescoring  rewrite.

Add  to cover both sides: PK-pruned rescoring restores implicit , while an eligible rescoring query still suppresses it for the row-filter path.

Review thread: ClickHouse#108846 (comment)

Verification:

- ninja -C build_verify programs/clickhouse

- tests/clickhouse-test --binary build_verify/programs/clickhouse --testname 04490_vector_search_rescoring_prewhere_eligibility

- tests/clickhouse-test --binary build_verify/programs/clickhouse --testname 02354_vector_search_rescoring 02354_vector_search_rescoring_and_prewhere 02354_vector_search_rescoring_distance_in_select_list 02354_vector_search_lazy_materialization 02354_vector_search_incident1654 04489_vector_search_rescoring_lazy_materialization 04490_vector_search_rescoring_prewhere_eligibility

- git diff --check
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
After gating implicit `PREWHERE` suppression on actual vector second-pass eligibility, indexed auto/postfilter queries in `02354_vector_search_nonindexed_columns` no longer keep the `WHERE` predicate as a plain filter when the PK filter leaves no usable vector row hints. The second pass does not apply the vector rewrite in that shape, so implicit `PREWHERE` is restored.

Update the reference and test comment to match the new intended behavior.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=108846&sha=f254dac3784c858c9287cba471f5ebf6a44cd9f8&name_0=PR&name_1=Stateless%20tests%20%28arm_asan_ubsan%2C%20targeted%29
PR: ClickHouse#108846

Verification:
- `tests/clickhouse-test --binary build_verify/programs/clickhouse --testname 02354_vector_search_nonindexed_columns`
- `tests/clickhouse-test --binary build_verify/programs/clickhouse --testname 02354_vector_search_nonindexed_columns 02354_vector_search_rescoring 02354_vector_search_rescoring_and_prewhere 02354_vector_search_rescoring_distance_in_select_list 02354_vector_search_lazy_materialization 02354_vector_search_incident1654 04489_vector_search_rescoring_lazy_materialization 04490_vector_search_rescoring_prewhere_eligibility`
- `git diff --check`
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…tor-rescoring-row-filter

Re-land exact row filtering for vector search rescoring queries
grantholly-clickhouse pushed a commit to grantholly-clickhouse/ClickHouse that referenced this pull request Oct 10, 2026
After a lightweight `DELETE`, a vector search returned fewer rows than its `LIMIT` and missed true
nearest neighbours:

    INSERT INTO hv SELECT number, [toFloat32(number % 97), toFloat32(number % 31)] FROM numbers(10000);
    DELETE FROM hv WHERE id IN (5, 3012, 6019, 9026);       -- the exact matches of [5, 5]
    SELECT count() FROM (SELECT id FROM hv ORDER BY L2Distance(v, [5.0, 5.0]) LIMIT 10);  -- 6

Deleting a whole cluster of near neighbours emptied the result. The rows that were returned were also
not the nearest survivors: the deleted candidates shadowed them.

A lightweight delete does not rebuild a secondary index, so the vector index keeps returning the row
ids of deleted rows. Both vector-search optimizations then restrict the read to exactly those rows -
the rewritten plan without rescoring, and the exact row filter with rescoring - so `_row_exists`
removes the deleted candidates afterwards with nothing left to take their place. Before exact row
filtering was added (ClickHouse#108846, 26.7) the read covered the candidates' granules, so the surviving rows
there were rescored and the query still satisfied its `LIMIT`.

Skip both optimizations for a query whose parts have a delete the index does not know about: a
materialized lightweight delete, a delete mutation that is applied on the fly, or a patch part (which
can carry an update of `_row_exists`). The read then falls back to the candidates' granules, as before
26.7, until a merge or a mutation rebuilds the index.

`04491_vector_search_rescoring_lightweight_delete_filter` asserted the old behaviour - that the row
filter excludes a surviving granule mate after a lightweight delete, without checking that the `LIMIT`
is still satisfied - and now asserts that the index answer equals the bruteforce one.

Closes: ClickHouse#117286
Caused by: ClickHouse#108846
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors CI for issues found in CI 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.

4 participants