Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk6 min

pgvector Without Embeddings: When a Feature Vector Beats Semantic Search

You do not need model embeddings to use pgvector. Learn when structured feature vectors fit, how to design them, and when SQL or a hybrid approach is simpler.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Yes—you can use pgvector without model-generated embeddings. A hand-built feature vector can be a better fit when your data is structured and you already know which measurable attributes should make two records similar. For unstructured text or images, embeddings are usually the more natural starting point; for a task defined by only a few numeric conditions, ordinary SQL may be simpler than either.

Do you need embeddings to use pgvector?

No. pgvector is a PostgreSQL extension for storing supported vector types and finding nearby vectors with distance operators. It does not create the vectors or decide what their dimensions mean. An application can compute a vector from structured columns—such as measurements, counts, proportions, or other features—and store and compare it with pgvector.

As an Amazon Associate I earn from qualifying purchases.

That distinction matters: a vector is a representation, not automatically a semantic understanding of the record. With a hand-built feature vector, your choices about dimensions, normalization, weights, and missing values determine what “similar” means. This is a design heuristic, not evidence that hand-built vectors universally outperform embeddings.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When should you use a feature vector instead of semantic search?

Consider a feature vector when the records are structured, the product’s notion of similarity can be stated clearly, and the important attributes can be measured. For example, a recommendation system for equipment might compare known specifications if those specifications are what users mean by “similar.” If the meaningful features are difficult to enumerate—because they are implicit in prose, images, or other unstructured content—a model embedding is often a more natural candidate.

Approach Consider it when Main trade-off
Hand-built feature vector Data is structured and useful similarity dimensions are known and measurable. You control the named dimensions, but feature selection, scaling, weights, and missing-data handling require application-specific evaluation.
Model embedding Inputs are unstructured, such as prose or images, and useful similarity dimensions are hard to specify manually. A model supplies a learned representation, which is less directly interpretable than named hand-built dimensions.
Both Structured attributes and unstructured content contribute distinct similarity signals. You need to decide how to combine the signals; there is no universally established fusion method or guaranteed gain.
Ordinary SQL One or two numeric criteria or straightforward predicates capture the task. A vector representation and index may add needless complexity when a regular filter and sort express the requirement.

The useful question is not whether one representation is categorically better. Ask whether the representation matches the inputs and the relevance decision your application needs to make. Evaluate the candidates on that task rather than treating the word “semantic” or “vector” as a quality guarantee.

How to design a useful feature vector

Choose dimensions that express the real similarity question

Start by writing down what should make two records similar, then map that definition to source columns. A baseball-pitcher example in an Agave Information Solutions article published June 13, 2026 uses pitch-type shares, location means and spreads by pitch type, velocity averages and ranges where available, and changes in pitch mix by count. Those dimensions describe pitcher behavior; they are an illustration, not a general recipe for other domains.

Normalize attributes on different scales

If a large-scale measurement is mixed raw with a small-scale one, the large-scale value can dominate a distance calculation. Standardization such as z-scores or a fixed min-max range can put dimensions on more comparable scales. The right transformation depends on the data distribution and the behavior you want; validate it against representative examples rather than assuming one method is correct.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Weight dimensions deliberately

Scaling selected dimensions can express that some characteristics matter more than others. That control is interpretable, but the weights are still a product or domain decision. Explicit weights are not automatically relevant weights: assess whether the resulting nearest neighbors make sense for the application.

Represent missing values intentionally

A missing measurement is not the same as zero. The pitcher example notes that missing velocity readings were common in that author’s data and suggests imputing a population mean or dropping a dimension and renormalizing. Those are possible strategies, not independently validated rules. Choose a policy that preserves the meaning of absence in your data and apply it consistently when constructing query vectors.

What does a pgvector feature-vector query look like?

The following pattern follows the pitcher example: create a 32-dimensional column, add an HNSW index configured for cosine distance, and order candidates by cosine distance from a target vector. The 32 dimensions and request for 10 rows belong to that example; they are not recommended universal settings.

CREATE EXTENSION IF NOT EXISTS vector;

ALTER TABLE pitcher_profiles
  ADD COLUMN feature_vec vector(32);
CREATE INDEX ON pitcher_profiles
  USING hnsw (feature_vec vector_cosine_ops);

SELECT id, name
FROM pitcher_profiles
WHERE id <> @target_id
ORDER BY feature_vec <=> @target_vec
LIMIT 10;

The application must construct @target_vec using the same feature definitions and transformations used for stored profiles. The query ranks by the chosen distance; it does not infer or repair an unsuitable representation. In this example, the index operator class and ordering operator both use cosine distance.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When is a regular SQL query enough?

If the request is essentially “find records within this numeric range” or “sort by one measured value,” ordinary SQL filtering and sorting may be clearer and easier to maintain. Vector search becomes useful when similarity depends on a combined representation across multiple dimensions and the application needs nearest-neighbor ranking. A vector index is not a requirement just because the underlying values are numeric.

How do exact search and approximate indexes differ?

The pgvector project README says exact nearest-neighbor search is the default and provides perfect recall. Adding HNSW or IVFFlat enables approximate search, which can be faster but may return different results from exact search. The project describes HNSW as offering a better query-performance trade-off than IVFFlat, with slower index builds and greater memory use; IVFFlat builds faster and uses less memory, with lower query performance in that trade-off. These are upstream descriptions, not guarantees for a particular workload.

Search choice What to expect Important consideration
Exact nearest-neighbor search Perfect recall, according to the pgvector project README. Use it as a relevance baseline when assessing approximate results.
HNSW Approximate search using a multilayer graph; project documentation describes stronger query performance in the speed-recall trade-off than IVFFlat. Index builds are slower and memory use is higher than IVFFlat, according to the project documentation.
IVFFlat Approximate search that partitions vectors into lists and searches selected lists. It requires training and should be built after the table has data; project documentation describes faster builds and lower memory use, with lower query performance in the trade-off.

pgvector supports several distance operators: L2 distance (<->), negative inner product (<#>), cosine distance (<=>), L1 distance (<+>), and Hamming or Jaccard distance for binary vectors (<~> and <%>). Match the index operator class to the distance you intend to use. The negative sign in <#> lets PostgreSQL perform an ascending index scan for inner product.

Use IVFFlat settings as starting points, not promises

The project README suggests an initial number of IVFFlat lists of rows divided by 1,000 for tables up to one million rows, and the square root of the row count above one million. It suggests starting with the square root of the list count for probes. These are tuning heuristics, not benchmark results or universal optimal settings. More probes generally improve recall at a speed cost. Compare the chosen setup with exact search and benchmark it using your own data and query patterns.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How do filters affect approximate vector search?

With approximate indexes, filtering is applied after the index scan. The pgvector README illustrates the effect with a filter that matches 10% of rows and HNSW’s default ef_search value of 40: an average of four matching rows is expected from that scan. That illustration shows why a selective filter can leave too few qualifying results even when the unfiltered nearest-neighbor scan returns candidates.

The project documents iterative scans, indexes on filter columns, partial indexes for a few distinct values, and partitioning for many distinct values as possible approaches. Which is appropriate depends on filter selectivity, tenant boundaries, and how many results the application needs. Measure filtered results and latency rather than assuming an approximate index will return a fixed number of qualifying rows.

Can feature vectors and embeddings work together?

Yes, if structured attributes and unstructured content each carry a distinct relevance signal. You could retrieve by structured feature similarity and by text or image embeddings, then combine or rerank the candidates. The pgvector documentation discusses combining PostgreSQL full-text search with vector search and names Reciprocal Rank Fusion or a cross-encoder as possible result-combination approaches. These are options, not a universally best strategy; evaluate the combined results against the needs of the application.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.