Skip to content

Commit

Permalink
add limit for too large ef to avoid huge latency for iterator(#1814) (#…
Browse files Browse the repository at this point in the history
…1815)

Signed-off-by: MrPresent-Han <[email protected]>
  • Loading branch information
MrPresent-Han authored Dec 15, 2023
1 parent f12777b commit 71e667d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pymilvus/orm/iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ def extend_batch_size(batch_size: int, next_param: dict, to_extend_batch_size: b
if to_extend_batch_size:
extend_rate = DEFAULT_SEARCH_EXTENSION_RATE
if EF in next_param[PARAMS]:
return min(MAX_BATCH_SIZE, batch_size * extend_rate, next_param[PARAMS][EF])
real_batch = min(MAX_BATCH_SIZE, batch_size * extend_rate, next_param[PARAMS][EF])
if next_param[PARAMS][EF] > real_batch:
next_param[PARAMS][EF] = real_batch
return real_batch
return min(MAX_BATCH_SIZE, batch_size * extend_rate)


Expand Down

0 comments on commit 71e667d

Please sign in to comment.