Index of every page on this site: llms.txt
All skills
comet-ml avatar

/query-performance

@9b3d88e
by Cometcomet-ml/opik23k stars
1,964
Run it yourself

Validate what a ClickHouse query actually costs before merging it — at production scale through read-only environment access, or on a revived Testcontainers dataset extrapolated to 20k/500k/1M entities. Use when a DAO query changes, when an endpoint is slow, or when a reviewer asks "what does this cost at scale".

  • 4 files
  • 20.1 KB
  • Updated 3 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/comet-ml/opik/query-performance

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

rendering.md

≈357 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Getting Runnable SQL Out of a DAO

DAO queries in apps/opik-backend/src/main/java/com/comet/opik/domain/ are Java text blocks carrying StringTemplate directives (<if(x)>…<endif>, <filters>) and r2dbc named parameters (:workspace_id), so they cannot be run as written. Render them outside Java — resolving the directives for one call site and substituting the parameters — and produce:

  • one rendering per call site, because a single constant serving a list page and a by-id lookup binds different parameters and can be improved for one while regressing the other. Take the bindings from the Java (bind( / ifPresent(… bind …) around TemplateUtils.newST(…)), not from a guess;
  • the same constant rendered from main, so the baseline is the current production query.

Two failure modes to rule out before trusting a rendering: a surviving :param (it silently becomes a different query, so fail loudly instead), and a call site rendered with the wrong parameter set. Diff renderings rather than sources when checking a refactor — a comment-only or formatting-only edit must produce an identical query once comment lines are stripped.

Repo hazard: a line inside a query containing only -- makes ClickHouseParameterizedQuery stop substituting later :params, so the real endpoint fails with Code: 62 Syntax error … :workspace_id even though your rendering looks fine.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 9b3d88e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 3 months ago

README badge

README badge for comet-ml/opik/query-performance