rerun-catalog-queries
What it does
This skill gives your AI performance tips for reading data from a Rerun catalog in Python. It is for developers whose dataset queries feel slow or who build pipelines that query many segments.
When to use it
- βWhen a query to a Rerun catalog from Python is slower than expected.
- βWhen you are exploring an unfamiliar dataset in a Rerun catalog.
- βWhen you are building a per-episode pipeline that calls the catalog many times.
Skill link
https://github.com/rerun-io/rerun/blob/main/skills/rerun-catalog-queries/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βMy Python script that reads from the Rerun catalog is very slow. How can I speed it up?β
5 new skills a week. 1 minute to read.
How it works
The skill explains that each read is one cloud round trip, and shows how to reduce the number of trips and the amount of data sent back.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Rerun catalog queries
Practical performance patterns for querying a Rerun catalog
from Python (rerun.catalog.CatalogClient β
dataset.reader(...) β DataFusion DataFrame). The DataFusion side of
the stack is covered by the datafusion-python skill β load that
for DataFrame / SessionContext / expression-API references. This
skill focuses on catalog-specific behaviors and the round-trip costs
that catch teams off guard.
Connect with a rerun:// URL
from rerun.catalog import CatalogClient
client = CatalogClient("rerun+https://api.example.cloud.rerun.io:443")
dataset = client.get_dataset(id=dataset_id)
CatalogClient takes a rerun:// or rerun+https:// URL, or
rerun+http:// for a local server. Do not pass a plain https:// URL.
A segment URL such as
rerun://host:443/dataset/<dataset-id>?segment_id=<segment-id> gives
the server, the dataset id and the segment id.
The client reads the token from REDAP_TOKEN, or from the stored
credentials of rerun auth login, so token= is usually not needed.
The query cost model in one sentence
Every materialization of a dataset.reader(...) DataFrame is one
cloud round-trip, with most of the cost being the network/decode
pair, not the compute. Plan for round-trip count and payload bytes, in
that order.
A typical catalog round-trip is a few seconds even for a tiny result. So:
- 30 segments Γ 1 query each β 90s. (Naive per-segment loop.)
- 30 segments Γ 4 queries each β 6 minutes. (A splitter that runs
count+collect_columnfor both starts and stops.) - 1 query covering all 30 segments β 3s.
The same fan-out happens along the entity axis: 10 entities Γ
1 filter_contents([one_entity]).reader() each β 30s, vs one
filter_contents([all_entities]).reader() β 3s. Push as much as you
can into one round-trip β across segments and across entities.
Always apply filter_contents and time-window filters before .reader(...)
The single biggest lever:
filter_contents([entity_globs])restricts which entity-path columns the reader produces. Without it, every entity in the dataset is read.- Time-window filters push down to storage and dramatically reduce
bytes scanned when they compare the bare index column with a literal:
df.filter(col(index) >= lit(start)).filter(col(index) <= lit(end)). Integer, timestamp and duration literals of any unit work. Acastor arithmetic on the index column is not pushed down.
Combined: dataset.filter_segments(seg).filter_contents(entities).reader(...) .filter(in_window).select(...).
df.cache() is your friend for repeated probes
When the same materialization gets used by multiple downstream
filter/count/collect calls, materialize once with DataFrame.cache()
and operate on the cached frame:
cached = (
dataset
.filter_segments(seg)
.filter_contents([entity])
.reader(index=index_col)
.select(col(index_col).cast(pa.int64()).alias(index_col), value.alias("v"))
.cache() # one network round-trip, materializes into in-memory batches
)
starts = cached.filter(col("v") == start_val).collect_column(index_col)
stops = cached.filter(stop_pred(col("v"))).collect_column(index_col)
Without cache(), each count() / collect_column() re-executes the
whole reader chain.
When NOT to cache. cache() forces materialization into Arrow
batches, breaking laziness. If downstream code keeps composing more
DataFusion ops on top (joins, windows, further filters) and only
materializes once at the end, caching mid-pipeline turns one execution
into two and pre-empts whatever physical-plan optimizations the engine
could have done across the boundary. Reach for cache() when the
consumers are terminal (count(), collect_column(), to_arrow_table()),
not when they're another lazy DataFrame.
Cross-segment batching: drop filter_segments, group by rerun_segment_id
For pipelines that need the same query on many segments, omit
filter_segments(...) entirely and pull a single cross-segment table.
Every reader row carries a rerun_segment_id column β group locally:
df = dataset.filter_contents(entities).reader(index=index_col)
cached = df.select(
"rerun_segment_id",
col(index_col).cast(pa.int64()).alias(index_col),
value.alias("v"),
).cache()
# Now N filter/aggregate calls are local, not network.
starts = cached.filter(col("v") == start_val).select("rerun_segment_id", index_col).
FAQ
How should I connect to the catalog?
Use a rerun:// or rerun+https:// URL, not a plain https address. The client can read the token from REDAP_TOKEN.
Which library handles DataFrame work?
The skill points to the datafusion-python skill for DataFrame and SessionContext details.
Why are queries slow?
The skill says a typical round trip takes a few seconds, so the number of reads matters most.
Details
Original description by the author
Performance patterns and gotchas for querying a Rerun catalog from Python. Reach for this when exploring an unfamiliar dataset, when a CatalogClient/dataset query is unexpectedly slow, or when shaping a per-segment / per-episode pipeline that hits the catalog from many places.
repo: rerun-io/rerun
Popularity
- GitHub stars
- 12k
- Ranking position
- #11549
- License
- Apache-2.0
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
investigate-puffin
12kLets your agent investigate Puffin profiler recordings (.puffin files), find slow code sections and compare traces from before and after a change.
rerun-blueprint
12kTeaches your agent to change how the Rerun viewer looks by writing a blueprint for a recording or table, including layout, views and hidden columns.
rerun-chunk-processing
12kTeaches your agent to build Rerun data pipelines with readers and lenses that convert MCAP, Parquet, video or RRD files into recordings.
rerun-data-model
12kHelps your agent map robot or multimodal data onto Rerun's data model, deciding entities, components and static or time-based values first.
Similar skills
discrawl
394kLets your agent search and summarize a saved local archive of Discord messages, check how fresh it is, and read direct messages.
clickhouse-io
280kHelps your agent optimize queries and schemas in ClickHouse databases. It applies best practices for high-performance analytical workloads. Use when analytical queries are too slow.
scientific-db-pubmed-database
280kHelps your agent search for scientific articles in the biomedical field. It's useful for research needing specific medical information.