Zum Inhalt springen
Skillpedia
Datenbanken12k · #11549

rerun-catalog-queries

Was er macht

Dieser Skill gibt deiner KI Leistungstipps für das Lesen von Daten aus einem Rerun-Katalog in Python. Er ist für Entwickler gedacht, deren Datenabfragen sich träge anfühlen oder die Pipelines bauen, die viele Segmente abfragen.

Wann du ihn nutzt

  • ✓Wenn eine Abfrage an einen Rerun-Katalog aus Python langsamer ist als erwartet.
  • ✓Wenn du einen unbekannten Datensatz in einem Rerun-Katalog erkundest.
  • ✓Wenn du eine Pipeline pro Episode baust, die den Katalog viele Male aufruft.

Link zum Skill

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

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/rerun-io/rerun/blob/main/skills/rerun-catalog-queries/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Mein Python-Skript, das aus dem Rerun-Katalog liest, ist sehr langsam. Wie kann ich es beschleunigen?”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Der Skill erklärt, dass jeder Lesevorgang eine Netzwerk-Rundreise zur Cloud ist, und zeigt, wie du die Anzahl der Rundreisen und die zurückgeschickte Datenmenge verringerst.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von 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).
Häufige Fragen

Wie verbinde ich mich mit dem Katalog?

Verwende eine rerun://- oder rerun+https://-URL, keine einfache https-Adresse. Der Client kann das Token aus REDAP_TOKEN lesen.

Welche Bibliothek übernimmt die DataFrame-Arbeit?

Der Skill verweist auf den Skill datafusion-python für Details zu DataFrame und SessionContext.

Warum sind Abfragen langsam?

Der Skill sagt, eine typische Rundreise dauert einige Sekunden. Deshalb kommt es vor allem auf die Anzahl der Lesevorgänge an.

Details

Originalbeschreibung des Autors

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

Beliebtheit

GitHub-Sterne
12k
Platz im Ranking
#11549
Lizenz
Apache-2.0
Aktualisiert
2.11.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills