Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallStart with the query PostgreSQL is actually running: use EXPLAIN (ANALYZE, BUFFERS) on the slow similarity query, then check its row estimates, chosen index, filters, execution time, and buffer activity. That plan tells you whether to fix a mismatch, a selective filter, an approximate-search setting, or something else. Don’t assume the solution is simply to add an index: pgvector uses exact search by default, and approximate indexes can trade recall for speed.
Why is my pgvector query slow?
Inspect the actual plan before changing index or search settings. Replace the example table, column, and query vector below with your own, and use the same filters and limit as the slow application query:
EXPLAIN (ANALYZE, BUFFERS)
SELECT id
FROM items
ORDER BY embedding <-> '[0.1, 0.2, 0.3]'
LIMIT 10;
ANALYZE executes the statement so PostgreSQL can report actual timing and row counts; use care with queries that have side effects. Compare estimated rows with actual rows at each plan step, and look for where execution time and shared-buffer reads accumulate. A large gap between estimated and actual rows can point to inaccurate assumptions about the data or filter selectivity. Also check whether the intended vector index appears in the plan, and whether a filter removes many candidates.
A sequential scan is not automatically a fault. PostgreSQL may reasonably choose one for a small table or a query where scanning and sorting costs less than using an index. Conversely, an index scan can still be slow if it examines many candidates or returns too few rows after filtering.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Is the query using the right distance operator and index?
The query’s distance operator and the index operator class must match. pgvector supports distinct operator classes for L2 distance, inner product, and cosine distance; create an index for each distance function your workload needs.
| Distance | Query operator | Example operator class |
|---|---|---|
| L2 (Euclidean) | <-> |
vector_l2_ops |
| Inner product | <#> |
vector_ip_ops |
| Cosine distance | <=> |
vector_cosine_ops |
For example, a cosine HNSW index and a query ordered by L2 distance do not express the same indexed search:
CREATE INDEX items_embedding_cosine_idx
ON items USING hnsw (embedding vector_cosine_ops);
SELECT id
FROM items
ORDER BY embedding <=> '[0.1, 0.2, 0.3]'
LIMIT 10;
Use the same intended operator in the query’s ORDER BY as the operator class supports. If the query uses a different distance, create the corresponding index if that search is needed. For vectors normalized to length 1, pgvector recommends inner product for best performance; confirm that normalization is true for the stored vectors and query vectors before relying on that equivalence.
Should you use exact search, HNSW, or IVFFlat?
By default, pgvector performs exact nearest-neighbor search, which provides perfect recall. HNSW and IVFFlat are approximate alternatives: they can reduce search work, but may return different neighbors and trade some recall for speed. Measure the choice on representative queries and data rather than assuming an index or setting will make your workload faster.
| Approach | When it can fit | Costs and considerations |
|---|---|---|
| Exact search | Perfect recall is required, or a conventional filter index narrows the candidate set enough for exact distance ordering. | Can require examining many vectors. Increasing max_parallel_workers_per_gather may speed exact search without a vector index; test on the actual workload. |
| HNSW | You want to evaluate an approximate index with a generally stronger speed/recall tradeoff than IVFFlat. | More memory use and slower index builds than IVFFlat. It can be created before the table contains data. |
| IVFFlat | Lower index memory use and faster index builds are important, and representative data is available before index creation. | Generally lower query performance in the speed/recall tradeoff than HNSW. Build after representative data is present; list and probe choices affect results and work. |
Tune HNSW by measuring recall and latency
pgvector documents HNSW defaults of m = 16, ef_construction = 64, and hnsw.ef_search = 40. Increasing ef_search generally improves recall at a speed cost. Try a different value for a single transaction with SET LOCAL, then compare query latency and result quality against an exact-search baseline:
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
BEGIN;
SET LOCAL hnsw.ef_search = 100;
EXPLAIN (ANALYZE, BUFFERS)
SELECT id
FROM items
ORDER BY embedding <-> '[0.1, 0.2, 0.3]'
LIMIT 10;
COMMIT;
The value shown is an example to test, not a recommended target for every workload. Keep tuning only if your measured latency and recall justify the tradeoff.
Tune IVFFlat lists and probes as starting points
IVFFlat needs representative data at index-build time. pgvector’s starting heuristics are about rows / 1000 lists for up to one million rows, and the square root of the row count above one million. Start probes around the square root of the number of lists. These are heuristics, not universal optima: increasing ivfflat.probes generally improves recall while increasing search work. Benchmark alternatives against exact results.
Why does an indexed query return fewer results after filtering?
With an approximate index, pgvector applies metadata filtering after scanning the ANN index. The candidates found by the vector search are therefore not all guaranteed to satisfy a condition such as WHERE category_id = 7. The project’s example illustrates the effect: if a filter matches 10% of rows and HNSW uses its default ef_search of 40, an average of four matching rows is expected. A query requesting ten results can return fewer than ten.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Use the plan to see how many rows the filter removes, then choose an approach based on filter selectivity and the number of distinct filter values.
For selective filters, test a conventional filter index and exact ordering
If a condition matches a small fraction of the table, a standard index on the filter column may let PostgreSQL identify that subset and sort its vectors exactly by distance. For example:
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
CREATE INDEX items_category_id_idx ON items (category_id);
SELECT id
FROM items
WHERE category_id = 7
ORDER BY embedding <-> '[0.1, 0.2, 0.3]'
LIMIT 10;
Check the resulting plan rather than presuming which path PostgreSQL will choose. For queries that commonly filter on multiple columns, consider whether a multicolumn filter index fits those predicates.
For approximate search with filters, use iterative scans where available
pgvector 0.8.0 introduced iterative index scans. In 0.8.0 or later, an iterative scan can continue searching until it finds enough qualifying results or reaches a configured limit. For HNSW, choose strict ordering or relaxed ordering for the transaction:
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →BEGIN;
SET LOCAL hnsw.iterative_scan = strict_order;
SELECT id
FROM items
WHERE category_id = 7
ORDER BY embedding <-> '[0.1, 0.2, 0.3]'
LIMIT 10;
COMMIT;
Strict ordering preserves distance order. Relaxed ordering permits slight out-of-order results and can improve recall. IVFFlat also supports iterative scans; use its ivfflat.iterative_scan setting to choose the ordering mode. Verify the installed pgvector version before using either feature.
Set scan bounds deliberately
Iterative scans are bounded. The pgvector project documents an HNSW default of hnsw.max_scan_tuples = 20000 and hnsw.scan_mem_multiplier = 1; IVFFlat has ivfflat.max_probes. Raising a bound can let a search examine more candidates, but may increase work or memory use. Change bounds incrementally and check result count, recall, latency, and the actual plan.
Use partial indexes or partitioning for recurring filter patterns
If there are only a few distinct filter values, partial vector indexes can target those values. If there are many, partitioning may be a better fit. For tenant isolation, pgvector recommends list partitioning or separate tables: a shared approximate index can allow one tenant’s vectors to affect another tenant’s search speed and recall.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
How should you preserve ordering or apply a distance threshold?
Relaxed iterative scans can produce results slightly out of distance order. When strict final ordering is needed, pgvector documents materializing the nearest-results query and sorting its output. On PostgreSQL 17 and later, the documented final sort uses distance + 0:
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsWITH relaxed_results AS MATERIALIZED (
SELECT id, embedding <-> '[0.1, 0.2, 0.3]' AS distance
FROM items
WHERE category_id = 7
ORDER BY embedding <-> '[0.1, 0.2, 0.3]'
LIMIT 10
)
SELECT id, distance
FROM relaxed_results
ORDER BY distance + 0;
For a distance threshold, put the threshold outside a materialized nearest-results CTE, while keeping other filters inside it. That keeps the threshold from changing how the nearest-results search is formed:
WITH nearest_results AS MATERIALIZED (
SELECT id, embedding <-> '[0.1, 0.2, 0.3]' AS distance
FROM items
WHERE category_id = 7
ORDER BY embedding <-> '[0.1, 0.2, 0.3]'
LIMIT 100
)
SELECT id, distance
FROM nearest_results
WHERE distance < 0.5
ORDER BY distance;
Choose the inner limit and threshold for the application’s requirements; the example values are illustrative, not performance recommendations.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.How do you check whether your installed pgvector version supports a setting?
Check the installed extension version in the database where the query runs:
SELECT extversion
FROM pg_extension
WHERE extname = 'vector';
The pgvector project’s changelog lists version 0.8.7, dated 2026-10-01, which includes an IVFFlat index-build buffer-overflow fix. It lists version 0.8.0, dated 2024-10-30, as introducing iterative scans and improvements to filtering cost estimation and HNSW query performance. A release note does not establish that upgrading will speed up a particular workload; test release-specific changes against your own query plans and results.
Recommended Free Tools
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Could loading, memory, or index maintenance be the bottleneck?
If index size or memory pressure is the issue, pgvector documents halfvec as a way to use a smaller working set, and binary quantization with reranking as an option for smaller indexes at scale. These approaches can change accuracy, so compare their results with your application’s acceptable quality and recall.
- Initial loading: bulk-load rows with
COPY, then add indexes after the initial load for best performance. - Adding an index in production:
CREATE INDEX CONCURRENTLYavoids blocking writes, but still has operational constraints; plan and monitor the build. - HNSW vacuuming: vacuuming an HNSW index can take time. The project suggests reindexing concurrently before vacuuming to speed that process.
For horizontal scaling, the pgvector project names PostgreSQL replicas, Citus, and PgDog as possible approaches. Treat infrastructure changes as a later step: first establish where the query spends time, then benchmark end-to-end behavior under the workload you need to support.
How can you tell whether a tuning change helped?
Compare changes using the same representative data and query patterns. Record both performance and result quality; a faster approximate query is not a successful fix if it returns too few matches or unacceptable neighbors.
- Query latency and buffer activity from
EXPLAIN (ANALYZE, BUFFERS). - Recall or neighbor quality compared with exact-search results for representative queries.
- Whether filtered queries consistently return the required number of rows.
- Index build time, memory footprint, and write or maintenance impact.
Change one factor at a time where practical—such as the operator class, filter strategy, or search bound—so the plan and result differences are interpretable. Keep the plan and measurements for the before-and-after runs.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

