Optimizing ClickHouse Performance with AI
Use this guide when you have a slow ClickHouse query in a deployed MooseStack app on Fiveonefour and want your coding agent to help fix it. You can point it at a query you already know is slow, or let it find one worth optimizing. It benchmarks schema changes on isolated preview databases, then opens a pull request with the evidence for you to review. Nothing touches production until you review and approve the pull request.
What you need
A deployed MooseStack app on Fiveonefour
The workflow needs access to your hosting project to create preview branch databases.
Don't have a hosting project?Your coding agent
Cursor, Claude Code, Codex, Copilot, or similar
Query and PR review skills
You should be comfortable reading a ClickHouse query and reviewing a pull request.
What you don't need
Deep ClickHouse optimization expertise
The agent proposes schema changes and walks through the tradeoffs. You review what it found in the pull request.
Manual performance investigation workflows
The workflow handles diagnostics and benchmarking and puts the results in the pull request.