Understanding indexes
An index is the highest-level organizational unit of vector data in Pinecone. It stores vectors, serves queries over the vectors it contains, and does other vector operations over its contents.
Index types
There are two types of indexes:
-
Serverless indexes: With serverless indexes, you don’t configure or manage any compute or storage resources. Instead, based on a breakthrough architecture, serverless indexes scale automatically based on usage, and you pay only for the amount of data stored and operations performed, with no minimums. This means that there’s no extra cost for having additional indexes.
-
Pod-based indexes: With pod-based indexes, you choose one or more pre-configured units of hardware (pods). Depending on the pod type, pod size, and number of pods used, you get different amounts of storage and higher or lower latency and throughput.
Severless indexes are recommended for most use cases and are featured throughout these guides. For guidance on pod-based indexes, see Using pods.
Namespaces
Within an index, records are partitioned into namespaces, and all upserts, queries, and other data operations always target one namespace. This has two main benefits:
-
Multitenancy: When you need to isolate data between customers, you can use one namespace per customer and target each customer’s writes and queries to their dedicated namespace. See Implement multitenancy for end-to-end guidance.
-
Faster queries: When you divide records into namespaces in a logical way, you speed up queries by ensuring only relevant records are scanned. The same applies to fetching records, listing record IDs, and other data operations.
Namespaces are created automatically during upsert. If a namespace doesn’t exist, it is created implicitly.
Cloud regions
When creating an index, you must choose the cloud and region where you want the index to be hosted. The following table lists the available public clouds and regions and the plans that support them:
Cloud | Region | Supported plans | Availability phase |
---|---|---|---|
aws | us-east-1 (Virginia) | Starter, Standard, Enterprise | General availability |
aws | us-west-2 (Oregon) | Standard, Enterprise | General availability |
aws | eu-west-1 (Ireland) | Standard, Enterprise | General availability |
gcp | us-central1 (Iowa) | Standard, Enterprise | General availability |
gcp | europe-west4 (Netherlands) | Standard, Enterprise | General availability |
azure | eastus2 (Virginia) | Standard, Enterprise | General availability |
The cloud and region cannot be changed after a serverless index is created.
On the free Starter plan, you can create serverless indexes in the us-east-1
region of AWS only. To create indexes in other regions, upgrade your plan.
Distance metrics
When creating an index, you can choose from the following similarity metrics. For the most accurate results, choose the similarity metric used to train the embedding model for your vectors. For more information, see Vector Similarity Explained.
euclidean
Querying indexes with this metric returns a similarity score equal to the squared Euclidean distance between the result and query vectors.
This metric calculates the square of the distance between two data points in a plane. It is one of the most commonly used distance metrics. For an example, see our IT threat detection example.
When you use metric='euclidean'
, the most similar results are those with the lowest similarity score.
cosine
This is often used to find similarities between different documents. The advantage is that the scores are normalized to [-1,1] range. For an example, see our generative question answering example.
dotproduct
This is used to multiply two vectors. You can use it to tell us how similar the two vectors are. The more positive the answer is, the closer the two vectors are in terms of their directions. For an example, see our semantic search example.
Vector embedding
To store data in Pinecone, you need to convert your data to vector embeddings using an embedding model.
You can create a serverless index designed for integrated or standalone embedding:
-
Integrated embedding: In this case, you upsert and search with your source text, and Pinecone uses a hosted embedding model to convert the text to vectors automatically.
-
Standalone embedding: In this case, you use a standalone embedding model to convert your data to vectors, and then you upsert and search with those vectors directly. The standalone embedding model can be hosted on Pinecone or external.
Was this page helpful?