diff --git a/include/defaults.h b/include/defaults.h index ef1750fcf..1b21bc0b6 100644 --- a/include/defaults.h +++ b/include/defaults.h @@ -22,7 +22,7 @@ const float GRAPH_SLACK_FACTOR = 1.3f; // SSD Index related limits const uint64_t MAX_GRAPH_DEGREE = 512; const uint64_t SECTOR_LEN = 4096; -const uint64_t MAX_N_SECTOR_READS = 128; +const uint64_t MAX_N_SECTOR_READS = 500; // following constants should always be specified, but are useful as a // sensible default at cli / python boundaries diff --git a/src/pq_flash_index.cpp b/src/pq_flash_index.cpp index a13350294..8924be692 100644 --- a/src/pq_flash_index.cpp +++ b/src/pq_flash_index.cpp @@ -1677,8 +1677,8 @@ void PQFlashIndex::cached_beam_search(const T *query1, const uint64_t std::vector vec_read_reqs; - if (full_retset.size() > k_search * FULL_PRECISION_REORDER_MULTIPLIER) - full_retset.erase(full_retset.begin() + k_search * FULL_PRECISION_REORDER_MULTIPLIER, full_retset.end()); + if (full_retset.size() > defaults::MAX_N_SECTOR_READS) + full_retset.erase(full_retset.begin() + defaults::MAX_N_SECTOR_READS, full_retset.end()); for (size_t i = 0; i < full_retset.size(); ++i) {