Inspect stats
Read row counts, index state, and partitions from a collection's stats, alongside its name, key column, and external IDs.
stats() returns one dictionary describing a collection: the runtime statistics — row counts, index state, partitions — plus the collection's name, its partition-key column key_name, and its external_ids. Use it to read the size and shape of a collection without reading any records.
Read the stats
from telys import Telys
telys = Telys("./telys-data")
col = telys.open_collection("notes") # no embedder needed to read stats
s = col.stats()
print("name :", s["name"])
print("key column :", s["key_name"])
print("external :", s["external_ids"])
print("full stats :", s)What the dictionary contains
name
yes
The collection name.
key_name
yes
The physical partition-key column (from partition_by).
external_ids
yes
The live external IDs — mirrors len(col).
runtime stats
runtime-provided
Row counts, index state (exact / IVF), partition breakdown, and probe settings.
key_name is the single physical partition key. A list or tuple passed to partition_by uses only its first element — Telys builds no composite keys, so compose one string with scope_key(...) if you need several parts. See Partitions & scope keys.
Expected result
For a saved collection of 1,240 rows partitioned by scope, still on exact search:
external_ids always agrees with len(col). If index reports exact on a large collection, that is your cue to build an IVF index or run a tuning pass.
Next steps
Last updated
Was this helpful?