Skip to content

perf: High memory usage for batched vector query on flat KNN #6940

Description

@BubbleCal

#6828 introduced batched vector query, which supports passing multiple query vectors in single query request.

The implementation stores the record batches that referred by topk candidates, which could require m * k * d * 4 bytes at worst case, where m is the number of query vectors, k is the number of results for each query vector, d is the dimension of vector, 4 is sizeof(f32).

We don't need to store the raw vectors unless the query selects vector column, in most cases, vector column won't be selected, so this can significantly reduce the memory footprint

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions