writing-clickhouse-queries

Installation
SKILL.md

Writing ClickHouse queries for new products

If you're optimizing an existing query rather than writing a new one, this is the wrong skill. Use /optimizing-clickhouse-and-hogql-queries instead. That skill covers layer triage, smell scanning (FROM ... FINAL, JSONExtract over properties, missing skip indexes, self-joins, CTE blow-up), measurement on the Test Cluster, and applying the fix at the right layer.

Read docs/published/handbook/engineering/databases/clickhouse-queries-new-products.md for the authoritative guide on writing new queries.

Then pull in whichever related docs the task touches:

When to use

  • Writing or reviewing a QueryRunner subclass in posthog/hogql_queries/ or products/*/backend/
  • Adding a new ClickHouse table or ALTER for a product (posthog/clickhouse/migrations/)
  • Choosing a row ID format for a new table
  • Adding or removing materialized columns, skip indexes, or projections
Installs
3
GitHub Stars
513
First Seen
3 days ago
writing-clickhouse-queries — posthog/posthog-foss