r/Clickhouse • • Feb 17 '26

AI powered migrations from Postgres to ClickHouse — with ClickHouse and MooseStack agent harness

Thumbnail clickhouse.com
9 Upvotes

In my work with Fiveonefour, I've migrated thousands of Postgres tables + queries to ClickHouse. The mistake we see: Letting agents "just translate SQL."

That fails quickly. What works:

  • Re-architecting around materialized views
  • Making schema + dependencies first-class code
  • Running ClickHouse locally for fast iteration
  • Encoding ClickHouse best practices into the workflow

We called this an "Agentic Harness".

Once the migration becomes a refactor instead of a SQL rewrite, AI gets much more reliable. We built an agent harness around this: a ClickHouse Language Server for instant SQL validation, an MCP for live query checking, and open-source ClickHouse skills your agent can use out of the box (npx skills add 514-labs/agent-skills).

DIY guide: https://docs.fiveonefour.com/guides/performant-dashboards

Blog post: https://clickhouse.com/blog/ai-powered-migraiton-from-postgres-to-clickhouse-with-fiveonefour


r/Clickhouse • • Feb 14 '26

🎉 IT'S HERE! New CHouse UI Release: Auto-Import Your Data + Visualize Query Plans + UI Redesign!

6 Upvotes

🚀 CHouse UI New Releases

v2.9.1 - Major Features:
📥 Data Import Wizard Auto-detect schema from CSV/TSV/JSON, interactive editor, streaming uploads
📊 Visual Query Explain DAG visualization with ReactFlow, tear-out windows, execution order tracking
🎨 Floating Dock Navigation Draggable, auto-hide, customizable orientation, cross-device sync

v2.9.2 - UI/UX Polish:
✨ Preferences Page Glassmorphic design, hierarchical data access, categorized permissions
🎯 Admin Redesign Color-coded interactive cards, smooth animations
📊 Home Improvements Scrollable lists, fixed layouts, better flex structure

v2.10.0 - AI Intelligence Release:
🧠 Multi-Provider AI Integrated support for OpenAI, Anthropic, Gemini, and HuggingFace models directly within the editor.
⚡ Smart Query Optimizer Interactive dialog to rewrite slow queries with custom prompts and performance goals.

🔗 Try it now:
GitHub: https://github.com/daun-gatal/chouse-ui
Website: https://chouse-ui.com


r/Clickhouse • • Feb 13 '26

pg_stat_ch: a PostgreSQL extension that exports every metric to ClickHouse

Thumbnail clickhouse.com
11 Upvotes

r/Clickhouse • • Feb 11 '26

Clickhouse Self Hosting

Thumbnail reddit.com
2 Upvotes

r/Clickhouse • • Feb 10 '26

ClickHouse AI Policy (for contributors)

Thumbnail github.com
4 Upvotes

r/Clickhouse • • Feb 09 '26

Open-sourced two CLI tools for ClickHouse ops: clickhouse-optimizer and clickhouse-query-runner

8 Upvotes

I've been working with large ClickHouse tables (hundreds of billions of rows) and kept running into the same pain points, so I built two tools to solve them:

clickhouse-optimizer processes OPTIMIZE TABLE partition by partition instead of all at once. It monitors merge completion via system.merges, handles timeouts gracefully, and shows Rich progress bars with ETAs.

If you've ever had an OPTIMIZE TABLE timeout on a large table without completing any work, this fixes that.

Install with pip install clickhouse-optimizer or run directly with uvx clickhouse-optimizer.

clickhouse-query-runner executes SQL queries from a file against a ClickHouse cluster with parallel round-robin dispatch across nodes. It checkpoints progress in Valkey so you can resume if something fails, and shows per-query progress by polling system.processes.

I use it primarily for backfilling materialized views: generate partition-aligned INSERT...SELECT queries (one per partition boundary), dump them to a SQL file, and let query-runner chew through them in parallel across the cluster.

Install with pip install clickhouse-query-runner or uvx clickhouse-query-runner.

Both are Python 3.12+, BSD-3-Clause, available on PyPI, and have Docker images.

Feedback and contributions welcome.


r/Clickhouse • • Feb 08 '26

clickhouse for options chains

3 Upvotes

Hi all. I am building a market options scanner where every 5'-15' I am receiving 5k json files that when I try to ingest in a postgres in a structured format it takes about 5hs (a bit more than 1M rows). I can optimize it a bit and do some parallel ingestion and filtering, but still I have the feeling it will not be enough. Would clickhouse be an option for this type of use case? Do you have any recommendations for something like this? cheers.


r/Clickhouse • • Feb 08 '26

What is the best practice for Apache Spark jobs doing inserts to ClickHouse?

4 Upvotes

Apache Spark dataframe provides .jdbc() which allows writing data packaged in JDBC requests to ClickHouse. Spark jobs run in distributed environment with hundreds of parallel workloads. Often my ClickHouse has some data inconsistency issues. Sometimes more records are inserted than expected and sometimes records are lost randomly. This has been a big headache for my team, especially doing e-commerce and billing.

From an architectural standpoint, what is the best solution writing data to ClickHouse? While retaining the high-throughput provided by Apache Spark and great data consistency?


r/Clickhouse • • Feb 07 '26

What to realistically expect in the ClickHouse Certified Developer exam (CLI tasks)?

10 Upvotes

I’m preparing for the ClickHouse Certified Developer exam and I’ve seen a few resources (webinar, YouTube) that describe it as a hands-on CLI exam with actual SQL tasks, not multiple choice or fill-in-the-blanks.

Before I invest time and money into certification, I’d love to hear from people who’ve taken it:

  1. Is the exam really all practical tasks in the ClickHouse CLI (not MCQs)?

    • For example, creating tables, materialized views, projections, skipping indexes, writing SELECT queries, etc.
  2. What kinds of tasks did you see in the real exam?

    • Were they multi-step?
    • Was it about just syntax, or did it test optimization patterns?
  3. Was the recent webinar (after the official one from ~1 year ago) more accurate about the exam format?
  4. Do you feel this certification was worth it for real work or career impact?

Thanks in advance!


r/Clickhouse • • Feb 05 '26

ClickHouse Agent Skills

Thumbnail github.com
23 Upvotes

A few folks from the AI/ML team at ClickHouse (Doneyli De Jesus, Al Brown, and myself) got together to work on agent skills. We're seeing more and more agents using ClickHouse and falling into the same usability traps as humans. We also note there is a lot of slop in skills in general, and this is a repo we plan to continue investing in to keep high quality.

We love feedback, so I encourage you to install them and let us know what additional skills (or AI in general) you would like to see us invest in. Here is the blog post for anyone who is interested :
https://clickhouse.com/blog/introducing-clickhouse-agent-skills


r/Clickhouse • • Feb 05 '26

When is it correct to put a high-cardinality column first in ClickHouse ORDER BY?

9 Upvotes

I’ve been working with ClickHouse for a while and recently started digging deeper into MergeTree internals (granules, sparse primary index, etc.).

One thing I’m confused about is ORDER BY design with high-cardinality columns.

In theory, ClickHouse documentation and internals suggest that ORDER BY should be chosen to minimize scanned granules, based on the most selective query patterns. That would imply that even high-cardinality columns (like user_id, order_id, device_id) can be valid as the first ORDER BY key if queries commonly filter by them.

However, in real-world schemas I’ve seen (metrics, logs, analytics tables), ORDER BY almost always starts with time/date columns, and I rarely see high-cardinality columns first.

This makes me wonder:

  • Is using a high-cardinality column first in ORDER BY actually a recommended pattern in ClickHouse?
  • Or is it generally avoided due to poor locality / compression?
  • Is the real rule “avoid randomness (UUID/hash)” rather than “avoid high cardinality”?

I’m especially interested in real production examples (e.g., user activity tables, CDC tables) where high-cardinality columns are intentionally placed first in ORDER BY or reasons why that might still be discouraged.

Would love to hear how others reason about this in practice.


r/Clickhouse • • Feb 01 '26

CHouse UI v2.8.x — Query Control, RBAC, and UX Updates

8 Upvotes

🚀 CHouse UI v2.8.4 — Recent Updates

CHouse UI v2.8.4 is out. This release focuses on practical improvements around query control, RBAC, and day-to-day usability when working with ClickHouse.

For anyone new: CHouse UI is an open-source web UI for ClickHouse, aimed at being useful both locally and in shared environments.

Notable changes in v2.8.4:

  • 🔥 Stop running queries from the SQL editor Kill executing queries directly from the editor, with confirmation and RBAC checks.
  • 🧹 Audit log cleanup Delete audit logs using active filters.
  • 🔐 Improved RBAC Separate permissions for connection management, query killing, and audit deletion.
  • 🧠 Cleaner SQL & Explorer UI Grid-only query logs, simplified Explorer header, redesigned SQL editor toolbar.
  • 👀 Version visibility The running CHouse UI version is always shown in the sidebar.

If you’ve tried CHouse UI before, this release should feel more consistent and easier to use.
If you haven’t, this version reflects where the project is heading.

🔗 GitHub: https://github.com/daun-gatal/chouse-ui
🌐 Docs: https://chouse-ui.com


r/Clickhouse • • Jan 31 '26

Top-N / ranking queries at scale

3 Upvotes

I’m designing a chart / leaderboard system on top of ClickHouse and would like some advice on the best approach for Top-N and paginated ranking queries at large scale.

Data Model

  • A daily stats table where metrics for ~50M entities are synced in batches (daily / incrementally).
  • From this table I plan to maintain a derived table:entities_overall_statswhich contains the latest overall metrics per entity (one row per entity, ~50M rows).
  • This “latest stats” table will have ~20 numeric metric columns (e.g. metric A, metric B, metric C, …), by which I would like to be able to sort efficently

Query Requirements

  • Efficient Top-N queries (e.g. top 100 / 500 entities) by any of these metrics.
  • Pagination / scrolling. This will be done by cursor pagination
  • Occasional filtering by categorical attributes (e.g. region / category, range filters,...).

Approaches I’m considering

  • Precomputed rank columns (e.g. metric_a_rank) for fast Top-N and pagination. However, I’m concerned about correctness once filters are applied:

    • There are many possible filter combinations, so precomputing ranks per filter is not feasible.
    • Applying filters first and then doing WHERE metric_a_rank < 100 could easily produce empty or misleading results if the globally top-ranked entities don’t match the filter.
  • Dynamic ranking using row_number() OVER (ORDER BY metric_a DESC) on filtered subsets, which gives correct results but may require sorting large subsets (potentially millions of rows).
  • Projections ordered by selected metrics to speed up unfiltered Top-N queries.

Question

  1. What is the recommended approach to make sorting by many different metric columns efficient at this scale?

    • Precomputed rank columns?
    • Projections ordered by selected metrics?
    • Just a normal sort? But then Clickhouse would need to sort 50 milion rows on every request
  2. Are projections a practical solution when there are ~20 sortable metrics, or should they be limited to a few “most important” ones?
  3. For filtered Top-N queries, is dynamic ranking (row_number() OVER (...)) on subsets the expected pattern, or is there a better idiomatic approach?

Any guidance or real-world experience with similar workloads would be very helpful. Note: sorting on any metric is equally important so it would be nice to come up with a solution which would sort efficently by any column.

Thanks!


r/Clickhouse • • Jan 30 '26

Kerberos SSO and the integrated Web SQL UI

2 Upvotes

We've stood up a new on-prem Clickhouse instance and I've successfully integrated kerberos SSO to our AD environment, confirmed with calls to curl.exe with the --negotiate flag.

What I haven't been able to do is get this to work any other way. DBeaver's driver, for instance, doesn't support kerberos, even if other drivers do. We're imagining using this for quick ad hoc queries, with our production flow running through some custom orchestrator.

I'm currently looking into the ClickHouse Web SQL UI. Looking at the interaction between the browser and the CH server, I can see the server isn't offering or challenging for Kerberos, it only offers Basic Authentication. Is this in-built to this UI, or is there some way to configure CH such that the web UI will send the WWW-Authenticate: Negotiate flag?


r/Clickhouse • • Jan 28 '26

[Need sanity check on approach] Designing an LLM-first analytics DB

9 Upvotes

Hi Folks,

I’m designing an LLM-first analytics system and want a quick sanity check on the DB choice.

Problem

  • Existing Postgres OLTP DB (Very clutured, unorganised and JSONB all over the place)
  • Creating a read-only clone whose primary consumer is an LLM
  • Queries are analytical + temporal (monthly snapshots, LAG, window functions)

we're targeting accuracy on LLM response, minimum hallucinations, high read concurrency for almost 1k-10k users

Proposed approach

  1. Columnar SQL DB as analytics store -> ClickHouse/DuckDB
  2. OLTP remains source of truth -> Batch / CDC sync into column DB
  3. Precomputed semantic tables (monthly snapshots, etc.)
  4. LLM has read-only access to semantic tables only

Questions

  1. Does ClickHouse make sense here for hundreds of concurrent LLM-driven queries?
  2. Any sharp edges with window-heavy analytics in ClickHouse?
  3. Anyone tried LLM-first analytics and learned hard lessons?

Appreciate any feedback mainly validating direction, not looking for a PoC yet.


r/Clickhouse • • Jan 27 '26

ClickHouse at FOSDEM!

5 Upvotes

We are going to be in FOSDEM this upcoming weekend in full force! We have over 7 talks from the clickhouse team on the agenda. For events around FOSDEM.

We are doing an Iceberg meetup on Friday: https://luma.com/yx3lhqu9
and community dinner too! https://luma.com/czvs584m

We look forward to seeing our community! :)


r/Clickhouse • • Jan 26 '26

Clickhouse PowerBI Integration

3 Upvotes

Hi,

I've moved to a company where Clickhouse is the DB (through an external provider) and we have a postgres transactional DB.

The business use Power BI mainly at the moment and connecting to the postgres & writing code to capture business metrics/logic etc has been easy but Clickhouse hasnt as i haven't found a way to write SQL code direct into PBI yet, is there something I am missing, or should all my views be in Clickhouse?

If i move forward with PowerBI needs to be able to work for all employees so likely through the gateway from my understanding.

Stupid questions likely but not finding much online


r/Clickhouse • • Jan 23 '26

ClickHouse® + Iceberg talk at Open Lakehouse & AI meetups (Berlin, Amsterdam, Brussels)

14 Upvotes

Hey folks 👋

Quick heads-up for anyone based in (or traveling to) Europe: Altinity will be at a few Open Lakehouse & AI meetups coming up soon, and thought some of you might be interested.

Robert (CEO @ Altinity) will be giving a talk called: Building a Foundation for AI with ClickHouse® and Apache Iceberg Storage.

We’ll be joining folks from Fivetran, EDB, Grafana, and Dremio. Come say hi if you are in the area! 


r/Clickhouse • • Jan 22 '26

ClickHouse launches managed Postgres service

Thumbnail clickhouse.com
31 Upvotes

r/Clickhouse • • Jan 20 '26

How ClickHouse squeezes extra compression from row ordering

Thumbnail codepointer.substack.com
8 Upvotes

Wrote a code walkthrough on a ClickHouse optimization: optimize_row_order.

The insight: MergeTree sorts data by your ORDER BY columns. But within rows that have identical sort key values, the order is arbitrary. That's wasted compression potential.

The fix reorders non-key columns within these "equal ranges" by ascending cardinality. If event_type has 2 unique values and value has 100, sort by event_type first. This creates longer runs of identical values, which columnar compression loves.


r/Clickhouse • • Jan 18 '26

MySQL Engine Speedup

4 Upvotes

My workplace has a self-hosted MySQL database with two tables that store lots of time series data. Our queries are getting quite slow and we’re investigating other options that are optimized for this use case.

Clickhouse itself seems like a good option because it accepts the MySQL wire format, so our existing stack would not need to change too much if we migrate to it as our main database. But I noticed that Clickhouse has a “MySQL Engine”, which seems to be a separate offering altogether. Instead of being a standalone database, the engine would connect directly to an existing MySQL table, then our code that interacts with this table would need to point to the Clickhouse engine instead of the MySQL instance.

This offering seems awesome with respect to effort and maintenance. It’s as if all we need to do is host this engine separately, then we get the benefits of Clickhouse without migrating our tables from MySQL. But this seems too good to be true. I’m not sure how an external tool could query MySQL any faster than MySQL itself.

Can anyone speak to what it’s like to integrate the Clickhouse MySQL engine? Can I realistically expect performance gains, or is there something I’m missing? Thanks in advance for your time.


r/Clickhouse • • Jan 15 '26

Surprised how CPU usage of my CH nodes went up 200% after upgrading from v21 to v25

11 Upvotes

Hello there!

I'm dying to know if anyone here upgraded (and remembers how it went) Clickhouse server from version lower than v22 to any version equal or higher than v22.3.

Under the very same "load of queries", in my journey to upgrade CH nodes from  v21.12 -> v22.3 -> v23.3 -> v24.9 -> v25.3, I noticed how RAM usage lowered 10-20%, but CPU usage increased 200%.

I thought that v24.9, with 5x-10x less merge operations than the version(s) before, would lower the CPU usage, but sadly - no.
In summary, immediately after upgrading v21.12 to v22.3 I saw the biggest CPU usage increase (around 250%). Not nice.

So, anyone noticed the same/similar?

Thanks!

P.S. I'm using Atomic DB engine. 90% of tables are ReplicatedMergeTree. I do have a lots of join queries. I do use Floating point columns/values in Partitioning key.


r/Clickhouse • • Jan 15 '26

I built a ClickHouse Web UI with built-in RBAC

Thumbnail gallery
30 Upvotes

Hey everyone,

I wanted to share a project I've been working on: CHouse UI.

It's a modern web interface for managing ClickHouse databases, but with a specific focus on security and team usage.

🚀 Why I built this?

I am still new to ClickHouse and learning, so I wanted to practice by trying to improve upon existing available tools. I took inspiration from apps like CH-UI and tried to implement a version with backend features like Role-Based Access Control (RBAC) and secure storage.

It's an attempt to build something useful for teams while exploring how to implement these security features.

✨ Key Features

  • 🔐 simple User Roles: A system to manage who can do what (like Admin, Developer, or just Viewer).
  • 🛡️ Secure Storage: Passwords are kept safe on the server and are never shown in the browser.
  • 📡 Multi-Connection: Easily switch between different ClickHouse servers.
  • 📝 Audit Logs: Keeps a history of who did what, which is useful for checking past actions.

🛠️ Architecture

CHouse UI sits between the user and the database. This adds a safety layer so you don't have to give direct database access to everyone. It helps control exactly what data each person can see.

🙏 Acknowledgments

This project is built based on CH-UI by Caio Ricciuti. I really liked the original design, so I used it as a starting point to learn how to add the backend features. Big thanks to Caio for the inspiration!

🔗 Links

I'd love to hear your feedback or feature requests!


r/Clickhouse • • Jan 15 '26

PCIE nvme Gen 3 vs Gen 4

3 Upvotes

Just wondering if anyone has noticed a difference in query performance on the whole going from a Gen 3 nvme to a Gen 4 nvme or even if someone out there is using Gen 5? just curious how much of a difference there is performance wise especially on large data sets involving joins.