Use namespaces
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.Filter by metadata
In addition to increasing search accuracy and relevance, searching with metadata filters can also help decrease latency by retrieving only records that match the filter.Target indexes by host
When you target an index by name for data operations such asupsert
and query
, the SDK gets the unique DNS host for the index using the describe_index
operation. This is convenient for testing but should be avoided in production because describe_index
uses a different API than data operations and therefore adds an additional network call and point of failure. Instead, you should get an index host once and cache it for reuse or specify the host directly.
You can get index hosts in the Pinecone console or using the describe_index
operation.
The following example shows how to target an index by host directly:
When using Private Endpoints for private connectivity between your application and Pinecone, you must target the index using the Private Endpoint URL for the host.