Tuning Qdrant HNSW parameters

Qdrant HNSW parameters control the trade-off between search recall, query latency and index memory. This page explains which settings to change, how to change them on a live collection, and what to confirm before you do.

On this page

When Qdrant HNSW parameters decide search quality

If a Qdrant collection returns results too slowly or misses matches you expect, HNSW settings are a likely cause but not the only one. Confirm first whether the problem is in the index. HNSW, the Hierarchical Navigable Small World graph, is the approximate nearest neighbor index Qdrant uses to avoid comparing a query against every stored vector. Because it is approximate, a well-built index can still miss a true neighbor, and a poorly tuned one can be slow or inaccurate. The settings that matter fall into two groups: m and ef_construct shape the graph when it is built, while ef and full_scan_threshold act at query time. Changing a build-time setting affects the stored index, so it has a cost in indexing time and memory. Changing a query-time setting affects only how each search explores that graph.

Before changing anything, separate the symptoms. Slow searches can also come from filters without a suitable payload index, from quantization choices, from memory pressure, or from heavy writes during search. Missed matches can come from the embedding model, the distance metric, or filters that exclude the right results. Check the actual results against an exact search baseline on a labeled query set. The measuring recall topic in this group covers that check. Only when the gap traces back to the graph should you adjust HNSW. The Qdrant documentation lists the current defaults for each parameter, and those defaults change between releases, so confirm the values for the version you run before comparing them with your collection.

The open-source Qdrant engine is licensed under Apache-2.0, and you can self-host it without a license fee. Your costs are the infrastructure, the people who tune and operate it, and any vendor support you buy. HNSW tuning costs engineering time to measure and memory to hold the index, and both recur as the collection grows. Ask your internal team or your implementation partner to record the recall target, latency budget, and collection size before tuning starts. Those three numbers decide how much memory a higher m or ef_construct is worth to you.

Qdrant HNSW parameters and when each one fits

This table compares each HNSW lever by the phase it affects, what it trades against, and the workload where it is the right change. Read the indexing rows before building a collection, since some settings are costly to change later, and the search rows when tuning a live collection for recall or latency.

ParameterPhase and what it controlsMain trade-offRight lever when
m (edges per node)Indexing. Sets how many graph links each vector keeps in the HNSW graph.Higher values usually improve recall and add RAM and build time. Confirm the memory effect with the sizing guide before raising it.Recall stays low even with a generous search ef, and memory headroom exists.
ef_construct (build beam width)Indexing. Sets how thoroughly candidates are explored while the graph is built.Higher values improve graph quality and slow index builds. The effect on final query speed is indirect, so measure it.Graph quality is poor after bulk loads and you can afford longer indexing.
hnsw_ef (search ef at query time)Search. Sets how many candidates are explored per query. Set per request or as a collection default.Higher values raise recall and query latency. No index rebuild is needed, so it is the cheapest lever to test.Recall is short of target for one query type while latency has room to spare.
full_scan_thresholdSearch. Chooses when a filtered or small candidate set is searched exactly rather than through the graph.Lower values favor the graph and can slow restrictive filters. Higher values use more exact scans and cost more per query.Filters are very selective, or a small set of vectors should always return exact results.
Collection-level HNSW settingsIndexing. Applies to the collection's stored graph and to segments built after the change.Some changes need an optimizer or rebuild pass before they affect existing data. Confirm the exact behavior for your Qdrant version.You need a new graph layout for the whole collection rather than a per-query adjustment.
Payload indexes and filterable HNSWIndexing. Payload indexes must exist before ingestion for filterable graph links to be built.Adding indexes after ingestion requires a forced rebuild, and index memory adds to the total.Queries filter on tenant, category or date fields and recall drops under filters.
Memory cost of any increaseBoth phases. Graph size grows with m, and query memory follows the vectors and graph placement.Changes that look small per vector add up across millions of points and replicas.Before any change, estimate RAM with the capacity planning guide and test on a copy of the data.
Verification methodBoth phases. Compares results from approximate search with exact search on a labeled query set.Without a baseline, you cannot tell whether a change improved recall or only shifted latency.After every change to m, ef_construct, hnsw_ef or the threshold.

How m and ef_construct set the index memory cost

The two HNSW settings that decide how much memory the index graph uses are m and ef_construct, and both are fixed when the index is built. m sets how many links each node keeps to its neighbors in the graph. Every stored link takes space, so the graph's memory grows roughly in step with m, and a larger m also makes each insert touch more neighbors, which lengthens index build time. Treat m as a memory decision first and a recall decision second.

ef_construct controls how much candidate search Qdrant performs while it inserts each vector into the graph. A larger value finds better neighbors, so the graph tends to route queries more accurately, but every insert does more work and indexing slows down. It does not add links or consume graph memory in the way m does, which is why it is usually the cheaper lever to raise when recall at build time is the goal. Because the graph is built once with these values, changing either one later means rebuilding the index, not editing the collection in place.

Do not size the cost from these two parameters alone. The HNSW graph sits next to the vectors themselves, payloads, and payload indexes, and each of those takes its own share of RAM and disk. Confirm the graph size and the headroom you need with the Qdrant RAM and disk sizing guide before you change m, and run a test collection at your planned vector count to see the real footprint. Ask whoever sets your environment's targets which memory tier the graph must fit in, because that answer decides how far m can rise.

Search-time settings by workload

Retrieval for RAG and search quality asks the index to return the true nearest neighbors, so the search-time hnsw_ef value is the main lever. A higher value makes the graph search examine more candidates before it stops, which usually improves recall but adds distance computations and latency. Changing hnsw_ef at query time does not rebuild the index, so it is the cheapest experiment on this page. It cannot, however, recover what the index build never connected, so construction settings set the ceiling.

  • Start from an exact baseline: Run your query set against exact results before changing anything, so each recall change has a reference point. The measuring recall page explains the method.
  • Sweep search ef in steps: Record recall and latency at each value and stop where recall gains level off.
  • Check quantization before blaming HNSW: If vectors are quantized, missing recall may come from the quantization settings, including rescoring and oversampling. Read the quantization page.
  • Revisit construction only for a ceiling: If no search value reaches your recall target, m or ef_construct may need to change. That requires an index rebuild and raises memory use.
  • Track p99 alongside recall: Higher search ef usually increases tail latency, so record both on every run.

Before shipping, confirm recall on a labeled query set built from the queries your application sends in production.

How HNSW settings move from collection config to search results

The diagram starts with a query from the client, which reaches the collection's search ef and full_scan_threshold settings. Those settings decide whether the query traverses the HNSW graph or runs exact search across segments. Candidates then pass through an optional rescore step before results return. The lower path shows the build-time side, where m and ef_construct shape the graph as points are written and optimized. Check which settings are fixed at build time and which can change on a live collection.

Build-time graph settings feed query-time search parameters that select the search path.

How to change HNSW settings without recreating the collection

This sequence lets you move recall and latency toward a target by changing query-time settings first and index-level settings only when needed, with a baseline and a check at every step so each change can be judged and reversed.

  1. Record a baseline before changing anything

    Before touching any setting, capture the current collection configuration, including the HNSW block, quantization and payload index definitions, from the collection info endpoint. Run your labeled query set against the collection and record recall at k, p50 and p99 latency, and the memory used by the collection. Store these results with the exact Qdrant version and the settings they came from. Done means you have one saved report that a later run can be compared against, using the same query set and the same client settings.

  2. Build exact-search ground truth for the labeled queries

    Using the same labeled query set, run exact search with the full-scan option on the same collection, or on a copy if production load is a concern, and save the top results for each query. These results are the reference that recall is measured against. Confirm the reference is correct by spot-checking a few queries by hand against known relevant items. Done means every query in the set has a stored exact result list that the team has reviewed.

  3. Tune query-time search parameters first

    Change the search-time ef value and, where your client supports it, the full-scan threshold used at query time. These settings apply per request, so you can test several values in parallel against the same collection without a rebuild and roll back by changing the client configuration. Raise ef in steps and rerun the labeled set after each change. Done means you have a table of recall and latency for each value and have chosen the lowest value that meets your recall target within your latency budget.

  4. Check query-time changes against the baseline

    Compare each candidate's recall and p99 latency with the baseline and the exact-search reference. Watch for regressions in filtered queries separately from unfiltered ones, since filters can change the cost of graph traversal. Repeat the run at least once to rule out noise from cache state. Done means the chosen query-time values are recorded, the comparison is saved, and the team agrees that recall meets the target without an unacceptable latency increase.

  5. Confirm which HNSW fields need a rebuild

    Open the documentation for your exact Qdrant version and confirm which HNSW fields, such as m and ef_construct, can be updated on an existing collection and which require the optimizer to rebuild segments. Do not rely on memory or on older blog posts, because update behavior has changed between releases. Write down the answer for each field you plan to change, along with the expected memory effect of the new value. Done means a short change note lists each planned field, whether it is an in-place update or a rebuild, and the memory impact you estimated from your own sizing.

  6. Schedule the index change outside peak traffic

    For any change that triggers segment rebuilds, plan a window where query load is lowest, and notify the teams that depend on the collection. Rebuilds consume CPU, memory and disk I/O while they run, so confirm you have headroom for the temporary increase in resource use before starting. Keep the previous configuration written down so you can reapply it. Done means the change is approved, the window is set, and the rollback values are written in the change note.

  7. Apply the index change and wait for the optimizer

    Submit the collection update with the new HNSW values, then monitor the collection status and the optimizer state until indexing has finished and no segments remain waiting to be rebuilt. Watch memory and disk during the rebuild so you can stop the change if usage approaches your limits. Done means the collection reports that optimization is complete, the indexed point count matches the stored point count, and the memory figure is recorded for comparison.

  8. Rerun the baseline checks and record the result

    After optimization completes, rerun the labeled query set, recall and latency measurements, and memory check, then compare them with the baseline and the exact-search reference. Confirm that the query-time values you chose still give the expected recall on the new index, since index changes can shift results. If the outcome is worse, reapply the saved configuration and repeat the check. Done means the before and after report is saved with the Qdrant version, the settings, the date and the person who approved the change.

What higher recall costs in memory, latency and indexing time

Every step up in recall is paid for somewhere else: in graph memory, in how long index builds and optimizer runs take, in query latency, or in write pressure during loads. The cards below name each cost, what to measure to see it, and which sibling topic covers the fix.

Larger graph memory from higher m

The m parameter sets how many links each node keeps in the HNSW graph. Raising it improves connectivity and recall, but the graph grows with every extra link on every vector, so RAM use rises for the same vector count. Before you raise m, measure the HNSW footprint of a test collection at the current value and at the proposed one, and check whether that footprint still fits your memory tier. Memory planning for these figures is covered in the RAM and disk sizing topic.

Qdrant installation docs

Slower index builds from ef_construct

The ef_construct setting controls how many candidates Qdrant examines while it builds the graph. A higher value finds better neighbors and improves recall, but each insert does more work, so build time grows during the initial load and during later index updates. Time a full build at two or three ef_construct values on a sample of your real vectors and compare recall and build time together. Bulk loading strategies, including deferring HNSW indexing with indexing_threshold, are covered in the fast bulk uploads topic.

Higher query latency from search ef

Search-time ef controls how many candidates each query explores. Increasing it lifts recall for each query but adds distance computations, so p50 and especially p99 latency rise, and the effect compounds when many queries run at once. Set ef from a labeled query set rather than from intuition, then load test at your expected concurrency and record p95 and p99 latency at each value. Latency under concurrent writes is covered in the search latency under heavy writes topic.

Longer optimizer runs after changes

When you change HNSW settings on a collection that already holds data, Qdrant's optimizer must rebuild affected segments before the new values fully apply. Until those runs finish, searches may not reflect the new configuration, and the rebuild consumes CPU, memory and disk I/O on the nodes serving traffic. Check the collection status and optimizer progress after each change, and schedule changes outside peak hours. Monitoring optimizer behavior and health probes are covered in the monitoring and troubleshooting topic.

Pressure during bulk writes

Heavier HNSW settings make every insert more expensive, so a load that ran comfortably at default values can saturate CPU, starve search requests or exhaust memory when the same parameters are raised. The problem appears during ingestion and during steady-state writes that trigger segment merges. Run a representative load test with the target settings and watch write throughput, search latency and memory together, not each alone. Loading strategy and segment settings are covered in the fast bulk uploads topic.

False confidence without an exact baseline

A recall figure only means something when it is measured against exact search on the same data. Teams often raise m, ef_construct or ef based on how results look, then assume recall improved, or they test on a small sample that does not reflect the full collection. Build a labeled query set, compute exact nearest neighbors as ground truth, and record recall at k for each configuration. Re-run the check after changes to data, quantization or HNSW settings. The method is covered in the measuring recall topic.

How HNSW tuning interacts with quantization and payload indexes

Quantization changes what Qdrant stores and scores, so HNSW settings you tuned on full-precision vectors are a starting point, not a finished answer. When vectors are compressed, distances are computed on approximations, and the candidates the graph returns can shift. Re-check ef and the recall you get after enabling any quantization method, because a configuration that met your target at full precision may fall short once compressed. Rescoring and oversampling can recover some of the lost recall: oversampling asks the search to fetch more candidates from the compressed data, and rescoring recomputes distances for those candidates against the original vectors. Both add work per query, so the latency you measured before compression is no longer the right baseline. Confirm the exact parameter names and defaults for your Qdrant version in the Qdrant documentation, and see the sibling topic on choosing quantization for the method choice itself.

Filterable HNSW depends on payload indexes existing before ingestion for the best results. If a field used in filters is indexed only after the data is loaded, the graph may not have been built with the connections that make filtered traversal efficient, so tune m and ef_construct with your filter fields already in place. Restrictive filters, meaning filters that match a small share of points, change which search path is efficient. When few points qualify, traversing the graph and discarding most results wastes effort, and a scan over the matching subset can be faster. Qdrant's full_scan_threshold controls where that switch happens for a collection, so test it with the filters your application really sends rather than with unfiltered queries. The sibling topics on planning payload indexes for filtered search and on measuring search recall cover the index design and the recall checks in detail.

Security and operational controls for HNSW changes

HNSW settings change how a collection behaves for every caller that searches it, so who can change them and how those changes are recorded matter as much as the numbers. The four controls below cover access, audit, change records and shared-collection impact, which together decide whether a tuning change can be traced and reversed.

Who may change collection settings

Collection configuration changes, including HNSW updates, go through the same API as ordinary searches, so the key or JWT used to call it decides who can alter them. Qdrant ships with no authentication configured and listens on all network interfaces by default, so an unsecured instance lets any reachable caller change settings. Confirm that admin keys are limited to the people who own tuning decisions, that read-only keys are used for application search, and that JWT permissions grant write access only on the collections a team is responsible for.

JWT per-collection permissions
v1.9.0
Qdrant security docs

Audit trail for authenticated operations

Since v1.17.0, Qdrant writes JSON audit logs of authenticated API operations, which gives you a record of who sent a collection update. Without that record, a sudden drop in recall or rise in latency can be hard to tie to a specific change. Confirm that audit logging is enabled in your configuration, that logs are shipped to storage outside the Qdrant node, and that retention meets your policy. Test by changing a test collection's HNSW settings and checking that the log entry shows the calling identity.

Change control and rollback records

Each HNSW change should have a ticket that records the old and new values of m, ef_construct, search ef and full_scan_threshold, the reason for the change, the recall and latency measured before and after, and the person who approved it. Store the previous values with the change so that rolling back is a documented step, not a guess. Keep parameter files in version control where your team uses infrastructure-as-code, and confirm that the approval path matches the change process your auditors expect.

Shared collection blast radius

A collection shared by several tenants, teams or applications shares one index, so a change to m or search ef affects every caller at once. A setting that improves recall for one team can raise latency or memory use for all of them. Before changing a shared collection, identify every consumer, agree on the measured targets with each owner, and schedule the change outside peak traffic. Where tenants need different settings, plan separate collections with their own access rules rather than adjusting one shared index.

Questions teams ask before tuning Qdrant HNSW

How much work is HNSW tuning, and who should do it?

HNSW tuning is a bounded measurement exercise, not a rebuild of the system. The work is to measure recall and latency on your own data, change a small number of parameters (m, ef_construct, the search ef, and full_scan_threshold), and re-measure until the trade-off fits your requirements. An engineer who already runs your Qdrant cluster can do it, provided they can run controlled searches and watch memory. Teams that lack a query set, a baseline or a way to read cluster metrics usually take longer and get less reliable answers. Ask any partner to state in writing which parameters are in scope and how many tuning rounds are included.

Can our team tune HNSW without outside help?

Yes, if you have an engineer who can own the measurement loop. The minimum is a labeled set of representative queries, an exact search baseline for those queries, a test copy of the collection or a maintenance window, and access to the metrics that show memory and latency. The main risk is not the parameter changes themselves but measuring recall against the wrong baseline or tuning on a dataset that does not match production. Outside help is most useful for designing the query set, separating recall problems from quantization or payload index problems, and documenting the result so the next change can be checked against it.

What do we need to provide before tuning starts?

The work depends on four inputs from your side:

  • Labeled queries that reflect real user searches, including filtered searches, with the results you expect
  • Exact search baselines computed for those queries, so recall can be measured against a known answer
  • Access to a non-production copy of the collection with the same vector count, dimensions, datatype and payload indexes
  • Access to cluster metrics for latency, memory use and indexing progress, plus permission to run load against the environment

Without the first two, you cannot tell whether a change improved results. Confirm with your team how much production data you can copy into a test environment and under what data handling rules.

How long does a tuning cycle take, and what makes it longer?

A tuning cycle is one change to the HNSW settings, a rebuild or re-index of the affected segments, and a measurement against the baseline. Its length is set mainly by collection size, because rebuilding the HNSW graph takes longer as the vector count and dimensions grow, and by how many rounds the recall target needs. Duration also depends on how long you wait for indexing to finish before measuring. Ask for the number of rounds included, the environment used for each round, and what happens when a round does not meet the recall target. Do not accept a duration that is not tied to your collection size and environment.

What drives the cost of HNSW tuning up or down?

Cost follows the labor and the infrastructure time needed to run the measurements. The main drivers are collection size, the number of tuning rounds, whether you provide a test environment with production-like hardware, and how long rebuild windows are. Larger collections and more rounds mean more compute time and more engineer time per cycle. Access to a non-production copy with the same memory profile reduces rework, while a shared environment with limited rebuild windows slows every round. In a written quote, ask for the scope of rounds, who provisions and pays for test infrastructure, what is one-time work (initial baseline and parameter study) and what recurs (re-tuning after data growth or a Qdrant upgrade).

Does self-hosted Qdrant have costs beyond infrastructure?

The open-source engine is licensed under Apache-2.0 and is free to self-host, so the costs are infrastructure and people. Infrastructure includes the nodes, RAM, SSD or NVMe disk, and backup storage that the cluster uses. People costs include the engineers who operate the cluster, run upgrades, and maintain monitoring and tuning. Higher HNSW settings such as a larger m raise memory use, which increases the hardware you pay for each month. Paid Qdrant offerings such as Qdrant Cloud, Hybrid Cloud or Private Cloud are priced separately through Qdrant's pricing page and sales process, so confirm which product your quote covers before comparing costs.

Will changing HNSW settings require recreating the collection?

Not always. Some HNSW settings can be changed on an existing collection through the update path, and the change applies as the optimizer rebuilds the affected segments, so the collection stays online while that happens. Other changes need a new collection or a full re-index, which means a longer window and more memory during the rebuild. Check the current Qdrant documentation for the version you run before planning a change, and test the exact sequence on a copy first. Record the parameter values and the recall result for each round so you can roll back to a known setting.

Limits to confirm in your Qdrant version and environment

HNSW settings interact with the Qdrant release you run, the collection state, the cluster layout, the storage underneath and the service tier you buy. Each card below names one limit to confirm and where to confirm it before you change a value in production.

Parameter defaults and ranges

Confirm the default and accepted range for m, ef_construct, hnsw_ef and full_scan_threshold in the release you actually run, not in a blog post or an older client SDK. The latest release referenced for this guide is v1.19.2, published October 5, 2026, and the previous one is v1.19.0. Read the release notes between your version and the target before you copy a value from one environment to another, and record the exact version in your tuning log.

Qdrant releases

Fields that change on a live collection

Not every HNSW value can be changed in place. Check which parameters the collection update API accepts on an existing collection and which require creating a new collection and re-ingesting. Test the change on a copy of the collection first, then confirm that the optimizer rebuilds the index and that search results match the expected behavior before you point production traffic at it.

Qdrant installation docs

Replica and shard effects

In a distributed cluster, each shard and each replica builds its own HNSW index, so a higher m or ef_construct multiplies work and memory across copies. Confirm how a collection-level change propagates to every replica, whether it is applied while the cluster serves reads, and how the replication factor changes total storage. Plan around a cluster of at least three nodes, which the distributed deployment docs recommend for production so quorum survives a node failure.

Recommended production minimum
3 nodes
Distributed deployment docs

Block storage requirements

HNSW search speed depends on how quickly the index and vectors reach memory. Qdrant needs block-level storage with a POSIX-compatible file system, and it cannot run on NFS or object storage such as S3. Confirm that your volume type meets this rule in every environment, including Kubernetes persistent volumes and air-gapped hosts, and that SSD or NVMe drives back the data directory. A tuning result measured on the wrong storage will not match production latency.

Installation requirements

Memory headroom for chosen settings

Each increase in m adds graph links per vector, and a higher ef_construct slows the build without adding search memory. Measure memory use after a full index build with your real vector count, dimensions and payload indexes, then leave headroom for the optimizer, segment merges and any replica. Ask your Qdrant contact or check the capacity planning guide for the sizing formula that matches your release, and do not assume a value that fits on a test machine will fit on production nodes.

Managed tier exposure of settings

Qdrant Cloud tiers differ in what they expose and what they support. Before you plan HNSW tuning on a managed cluster, confirm whether the tier you buy lets you set collection-level HNSW values, whether private networking and SSO are included, and which uptime commitment applies to the tier. The pricing page lists a free single-node tier with 0.5 vCPU, 1 GB RAM and 4 GB disk, a Standard tier with a 99.5% uptime SLA, and a Premium tier with a 99.9% uptime SLA, so compare those limits against your recall and memory targets.

Qdrant pricing

How DeployOpen scopes and delivers HNSW tuning for Qdrant

DeployOpen approaches HNSW tuning for Qdrant as a written, fixed-scope piece of work inside infrastructure you control. We start from the recall, latency and memory targets your application needs, then set and test the index parameters against your own collection and query workload before handing over the settings and the reasoning behind them.

How we scope

  • Agree the recall target, latency budget and query mix for each collection before any parameter changes.
  • Inventory vector count, dimensions, datatype, payload indexes and current m and ef_construct values in the collection.
  • Write the scope, deliverables and timeline in advance, covering which collections and environments are in scope.

How we build

  • Run baseline measurements on a copy of the collection to record current recall, latency and memory use.
  • Test candidate m, ef_construct, search ef and full_scan_threshold values, applying changes through the collection update path.
  • Estimate the memory each increase adds and confirm it fits the node sizing before settings reach production.

How we hand over

  • Deliver the final parameter set with the measured recall and latency results behind each value.
  • Document the update commands, rollback steps and the order to re-check indexing once the collection has rebuilt.
  • Provide a labeled query set and re-check procedure so your team can repeat the recall measurement later.

How we support

  • Offer ongoing support and continuous testing as a retainer for collections whose data or query patterns change.
  • Re-run recall and latency checks after Qdrant upgrades, new payload indexes or large changes in vector volume.
  • Confirm support terms, response expectations and included retesting in the written agreement before work starts.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.