Performance: Pinecone cloud vector store
MEDIUM IMPACT
This concept affects the speed of vector search queries and the responsiveness of applications using Pinecone for similarity search.
async function searchVectorsBatch(queryVectors) { const results = await pinecone.query({ queries: queryVectors, topK: 10 }); return results; }
async function searchVectors(queryVectors) { for (const vector of queryVectors) { await pinecone.query({ vector: vector, topK: 10 }); } }
| Pattern | Network Calls | Backend Load | Latency | Verdict |
|---|---|---|---|---|
| Sequential single queries | Multiple calls (N calls for N vectors) | High (each query processed separately) | High (sum of all calls) | [X] Bad |
| Batch vector queries | Single call | Optimized (batch processed) | Low (one combined call) | [OK] Good |