---
title: "Introducing Postgres Query Insights in ClickHouse Cloud"
description: "Postgres Query Insights, now in preview for ClickHouse Cloud Managed Postgres, ranks every normalized query pattern by impact and aggregates per-execution counters (CPU, cache vs disk reads, temp spills, unlaunched parallel workers, WAL) to explain why a pattern is slow."
url: "https://swe.quest/articles/introducing-postgres-query-insights-in-clickhouse-cloud-a9697a827409b984"
canonical: "https://clickhouse.com/blog/postgres-query-insights-clickhouse-cloud"
source: "ClickHouse"
published: "2026-05-07"
difficulty: "medium"
kind: "Announcement"
reading_minutes: 7
tags: ["postgres","observability","performance","analytics"]
---

# Introducing Postgres Query Insights in ClickHouse Cloud

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2026-05-07, 7 min read, Announcement. Original: [https://clickhouse.com/blog/postgres-query-insights-clickhouse-cloud](https://clickhouse.com/blog/postgres-query-insights-clickhouse-cloud)

## Summary

Postgres Query Insights, now in preview for ClickHouse Cloud Managed Postgres, ranks every normalized query pattern by impact and aggregates per-execution counters (CPU, cache vs disk reads, temp spills, unlaunched parallel workers, WAL) to explain why a pattern is slow. A worked example traces a p99 regression to a sort spilling to disk, confirmed with EXPLAIN (ANALYZE, BUFFERS) and fixed with an index or work\_mem tuning. Telemetry comes from pg\_stat\_ch, an Apache 2.0 extension that normalizes literals at parse-analyze time so values and PII never leave the database. It enqueues raw per-statement events via a non-blocking try-lock on a shared-memory ring buffer at about 3% overhead, dropping events under pressure rather than back-pressuring Postgres.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Observability](https://swe.quest/tags/observability.md) (Reliability & operations)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)

## Prerequisites

- PostgreSQL query execution basics ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- EXPLAIN ANALYZE
- Postgres work\_mem and indexes ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))

## Keywords

pg\_stat\_ch, ClickHouse Cloud, Query Insights, PostgreSQL, EXPLAIN ANALYZE, work\_mem

## Related posts

- [pg\_stat\_ch: a PostgreSQL extension that exports every metric to ClickHouse](https://swe.quest/articles/pg-stat-ch-a-postgresql-extension-that-exports-every-metric-to-clickhouse-44a394f2889686fc.md): ClickHouse · 2026-02-13 · Hard · 16 min read · PostgreSQL, Observability, Performance engineering, Concurrency, Analytics & OLAP
  pg\_stat\_ch is an open-source (Apache 2.0) PostgreSQL 16–18 extension that captures every statement execution, including failed queries and DDL, as a fixed-size ~4.6KB event with 45 fields and streams it to ClickHouse for APM-style analysis.
- [London Meetup Report: Scaling Analytics with PostHog and Introducing HouseWatch](https://swe.quest/articles/london-meetup-report-scaling-analytics-with-posthog-and-introducing-housewatch-ed6b50855ec52fa1.md): ClickHouse · 2023-07-05 · Medium · 4 min read · Analytics & OLAP, Performance engineering, Observability, Databases
  PostHog scaled its product analytics platform by moving from Postgres to ClickHouse, with an events table holding roughly 62 TB uncompressed for a single column.
- [Postgres at Open House NYC](https://swe.quest/articles/postgres-at-open-house-nyc-5b2de1c38cc64f40.md): ClickHouse · 2026-10-13 · Easy · 6 min read · PostgreSQL, Replication, Event-driven architecture, Analytics & OLAP
  ClickHouse used its Open House NYC keynote to launch WalShadow, an open-source engine that replicates Postgres into ClickHouse from the physical WAL instead of logical replication.
- [LangChain - Why we Choose ClickHouse to Power LangSmith](https://swe.quest/articles/langchain-why-we-choose-clickhouse-to-power-langsmith-5117f6fe7184a57a.md): ClickHouse · 2024-04-23 · Medium · 9 min read · Analytics & OLAP, Observability, LLMs, PostgreSQL, Databases
  LangSmith, LangChain's LLM observability and evaluation platform, began fully on Postgres but outgrew it as users logged most of their production traces: ingestion lagged, precomputed materializations were rigid and costly, and lock contention grew.
- [“Just OLAP it”: How Ramp rebuilt its analytics platform on ClickHouse Cloud](https://swe.quest/articles/just-olap-it-how-ramp-rebuilt-its-analytics-platform-on-clickhouse-cloud-36298842faab88cc.md): ClickHouse · 2026-01-20 · Medium · 5 min read · Analytics & OLAP, Event-driven architecture, Data pipelines, PostgreSQL, Queues & messaging
  Ramp moved customer-facing spend analytics off its Postgres monolith after enterprise customers' reports on a single card-transactions table began taking 40+ seconds, and now serves them in milliseconds from ClickHouse Cloud.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
