Managing Indexes

1. Listing All Indexes

Example: List Indexes

indexes = pc.list_indexes()
for idx in indexes:
    print(idx["name"], idx["dimension"], idx["status"]["state"])

# Just names:
names = pc.list_indexes().names()
MethodReturns
list_indexes()IndexList object with full metadata
.names()List of index name strings
Node.js listIndexes(){ indexes: [...] }

2. Describing Index Configuration

Example: Describe Index

info = pc.describe_index("products")
print(info.host, info.dimension, info.metric, info.spec)
FieldDescription
nameIndex name
dimensionVector dim
metricDistance metric
hostAPI endpoint
specServerless or pod config
status{ ready, state }
deletion_protectionenabled / disabled

3. Checking Index Statistics

Example: Stats

index = pc.Index("products")
stats = index.describe_index_stats()
print(stats["total_vector_count"], stats["dimension"])
for ns, info in stats["namespaces"].items():
    print(ns, info["vector_count"])
FieldDescription
total_vector_countSum across all namespaces
namespacesPer-namespace vector counts
dimensionVector dim
index_fullness0–1; pod only

4. Configuring Index Settings

SettingMutable?API
replicasYes (pod)configure_index(replicas=N)
pod_typeUpgrade onlyconfigure_index(pod_type="p1.x2")
deletion_protectionYesconfigure_index(deletion_protection=...)
dimension / metricNoRecreate index

5. Monitoring Index Status

StateMeaning
InitializingProvisioning; not ready
ScalingUpAdding replicas/pods (pod)
ScalingDownRemoving replicas
ReadyAccepting traffic
TerminatingBeing deleted

6. Managing Index Deletion Protection

Example: Disable + Delete

pc.configure_index("products", deletion_protection="disabled")
pc.delete_index("products")
StateBehavior
Enableddelete_index returns 403
DisabledDeletion allowed

7. Deleting Index

Warning: Deletion is permanent and immediate. Always export data first or use a collection backup.
StepAction
1Backup via collection or external export
2Disable deletion protection
3pc.delete_index("name")

8. Handling Index Creation Errors

CodeCause
409Index name already exists
403Quota exceeded or invalid API key
400Invalid dim, metric, or spec
503Region temporarily unavailable

9. Estimating Index Capacity Needs

VariableFormula
Storage (bytes)vectors × (dim × 4 + metadata_size + 32)
Pod countceil(total_vectors / pod_capacity)
Replicasceil(target_QPS / single_pod_QPS)

10. Understanding Index Limitations

LimitValue
Max indexes per project20 (Standard), higher (Enterprise)
Max dim20000
Max metadata/vector40 KB
Max vector ID length512 chars
Max batch upsert2 MB or 1000 vectors