Skip to content

Allow issue vector search in batch mode #876

Closed

Description

@eddyxu

Problem Statement

Instead of query one vector a time, allows user to issue multiple queries in the same request, exposing more opportunity for internal parallisms.

enable vector searching for a batch of queries. Currently Lance only allows 1D queries, but allowing 2D queries (parallelized) would be useful.
Use case #1 is: at query time to run multiple simultaneous queries 'around' the root query to diversify search results, and #2 is useful for ETL operations (like the above deduplication)
Agree it would be amazing that lance support this api directly to minimize read requests to object store. Recent work to cache the index already helps

Activity

  1. trueutkarsh commented on Jul 5, 2023

    @trueutkarsh
    Contributor

    Hi @eddyxu,
    I have a few doubts regarding this problem which I wanted to discuss with you. With multiple queries instead of one

    • should we blindly spawn threads, create physical plans and execute them ? OR
    • does just adding more nodes in physical plan and executing all partitions instead of one seem like a possible solution ?
    • how does the recordbatchstream now look for the result ? Up until now we only had one result so that wasn't an issue but we should ideally get multiple RecordBatchStreams, so the result would also be an array of record batch streams ? Is this the expected behaviour you'd want or do we have to combine multiple streams.
      Thanks
  2. tullie commented on Aug 16, 2023

    @tullie

    Curious if there's any ETA for solving this? cc @trueutkarsh, @eddyxu, @changhiskhan. At the moment, we have to make many batch queries (batch_size=500) to lance, and this is a huge bottleneck for us.

  3. sadykovIsmail commented on Jun 9, 2026

    @sadykovIsmail

    Hi everyone, @eddyxu I'd love to take a stab at implementing this! I've been doing a lot of work with vector databases and RAG pipelines in Python, and adding a batch query API would be a massive performance boost for the dataflows I usually build.

    I'm going to start digging into how the 1D queries are currently handled. Since I'll be coming at this primarily from the Python side, could anyone point me to the best place to start looking within the Python bindings and how they currently map to the underlying Rust execution plan for queries?

    Also, if possible, could you please assign this issue to me so others know I am working on it? Thanks!

  4. Xuanwo commented on Jul 28, 2026

    @Xuanwo
    Member

    Closing as completed. Python batch vector search now accepts multiple query vectors and returns query_index; tests verify equivalence with repeated single-vector queries.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-indexVector index, linalg, tokenizerA-pythonPython bindingsenhancementNew feature or requestgood first issueGood for newcomershelp wantedExtra attention is neededrustRust related tasks

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions