본문으로 건너뛰기
Skillpedia
데이터베이스12k · #11549

rerun-catalog-queries

하는 일

이 스킬은 Python에서 Rerun 카탈로그의 데이터를 읽을 때의 성능 팁을 AI에게 제공합니다. 데이터셋 조회가 느리거나 여러 세그먼트를 조회하는 파이프라인을 만드는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓Python에서 Rerun 카탈로그 조회가 예상보다 느릴 때.
  • ✓익숙하지 않은 데이터셋을 Rerun 카탈로그에서 살펴볼 때.
  • ✓카탈로그를 여러 번 호출하는 에피소드별 파이프라인을 만드는 경우.

스킬 링크

https://github.com/rerun-io/rerun/blob/main/skills/rerun-catalog-queries/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/rerun-io/rerun/blob/main/skills/rerun-catalog-queries/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“카탈로그에서 데이터를 읽는 제 Python 스크립트가 아주 느립니다. 어떻게 빠르게 만들 수 있을까요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 스킬은 각 읽기가 클라우드 왕복 한 번이라고 설명하고, 왕복 횟수와 되돌아오는 데이터 양을 줄이는 방법을 보여 줍니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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_column for 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. A cast or 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).
자주 묻는 질문

카탈로그에는 어떻게 연결하나요?

평범한 https 주소가 아니라 rerun:// 또는 rerun+https:// URL을 사용해야 합니다. 클라이언트는 REDAP_TOKEN 환경 변수에서 토큰을 읽을 수 있습니다.

DataFrame 작업은 어떤 라이브러리가 맡나요?

DataFrame과 SessionContext 세부 사항은 datafusion-python 스킬을 참고하도록 안내합니다.

조회가 느린 이유는 무엇인가요?

일반적인 왕복에는 몇 초가 걸리므로, 읽기 횟수가 가장 큰 영향을 준다고 이 스킬은 설명합니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
12k
순위
#11549
라이선스
Apache-2.0
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬