Tracking: SQL Top-K performance for full-text and vector search

Open
#21,184 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@bohutang is already working on this.

Since Nov 24, 2026.

Assessment

This issue has not been assessed yet.

Description

Tracking

1. Merged

Full-text search

  • #20831
  • #21090
  • #21102
  • #21151

Vector search

  • #20744
  • #21026
  • #21059
  • #21071
  • #21093

2. Upcoming tasks

  • Share IndexTopNSource between FTS and vector search — draft PR #21185.
    When the index covers all eligible rows, select Top-K directly from its (score, row_id) pairs instead of running a zero-column scan and sorting again. Keep RowFetch for projected columns and the existing plan for queries the index cannot cover.

    Warm SQL Top-100, 64 clients, release ABBA against eb29e9a9d9 (base → patch):

    Workload SQL QPS Query CPU (ms/query) P99 (ms)
    FTS · MS MARCO 1M · 9 blocks 836 → 1,053 (+25.9%) 13.94 → 11.35 (−18.5%) 87.9 → 71.9
    Vector · Cohere 1M · 1 block 1,288 → 1,453 (+12.8%) 7.65 → 6.85 (−10.5%) 56.3 → 50.9

    Correctness: 1,000 queries per layout; scores matched at 0 float32 ULP. Only exact ties could reorder or exchange at the cutoff.

Shared SQL work and archived experiments

Shared SQL work

  • #21042
  • #21110
  • #21118
  • #21145

Parked or reference only

  • #21178
  • #21169
  • #21188 (found by the #21185 regression test; pre-existing on main)
  • #21101
  • datafuse-extras/tantivy#2
  • #15114
  • #17972
  • #21116
  • #21095
Dominant language
Rust
Stars
9.5k
Forks
903
Avg merge
2d 13h
Merged PRs (30d)
204

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from databendlabs/databend

All issues in databendlabs/databend

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.