Handle large numbers of deletes by metadata
Deletes, like upserts and updates, are blocking operations in Pinecone using pods. This means that if you submit a delete operation, subsequent reads (queries or fetches) may suffer increased latency until the delete is complete.
To work around this issue, we recommend batching your deletes the same way you would upserts or updates. Setting specific vector IDs in batches of 100 to 200 at a time will allow the index to process those deletes in sequence, and also allow for other operations to occur in between the batches.
The challenge to doing so is that most customers issue deletes either with metadata, or deleting all vectors in a namespace. This can impact performance across the index, including other namespaces.
So what do you do when you have to batch your deletes, but don’t have the IDs but do know the associated metadata you want to filter for? Just query for the IDs first, then batch delete those. This is an example of doing so using our Python SDK.
Using this method will allow more control over how many deletes are performed at a time and help avoid tying up other resources while they are being processed.
Was this page helpful?