Skip to content

Fix query per vector to not generate an empty retrieve request - #5910

Merged
timvisee merged 1 commit into
devfrom
fix-query-per-vector-empty-retrieve
Jan 30, 2025
Merged

timvisee merged 1 commit into
devfrom
fix-query-per-vector-empty-retrieve

Conversation

@agourlay

@agourlay agourlay commented Jan 30, 2025 •

Copy link
Copy Markdown
Member

When running a query request per vector value such as

POST collections/benchmark/points/query
{
  "query": [
      0.2,
      0.1,
      0.9,
      0.4
    ],
  "using": "dense",
  "limit": 4
}

we first try to find referenced vectors that need to be resolved.

In that case they are none.

However the implementation still generated a retrieve request for empty list for ids.

I discovered this while testing the rate limiter against the query endpoint which would mysteriously consume twice the amount of token per request.

The fix is two fold:

  • for the query API, do not generate empty retrieve request
  • for the collection API, shortcut all empty retrieve request to cover other potential misuses

The effects are:

  • fixing read rate limiters
  • increase performance of query per value by removing unnecessary segment and shard communication

@agourlay
agourlay marked this pull request as ready for review January 30, 2025 09:18
@agourlay
agourlay requested review from coszio and timvisee January 30, 2025 09:19
@timvisee
timvisee merged commit 5ea9fab into dev Jan 30, 2025
@timvisee
timvisee deleted the fix-query-per-vector-empty-retrieve branch January 30, 2025 10:28
@timvisee timvisee mentioned this pull request Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants