ℹ️ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 0.1 months ago |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://clickhouse.com/videos/how-to-compute-running-aggregation-in-clickhouse |
| Last Crawled | 2026-04-18 03:12:23 (1 day ago) |
| First Indexed | 2023-10-02 14:45:18 (2 years ago) |
| HTTP Status Code | 200 |
| Meta Title | How to Compute a Running Aggregation in ClickHouse |
| Meta Description | null |
| Meta Canonical | null |
| Boilerpipe Text | Rich Raposa
Director, Global Learning, ClickHouse
Using aggregate functions in a materialized view in ClickHouse can lead to surprising results if you don't define them properly. The AggregatingMergeTree table engine requires special column types for representing and storing intermediate (running) totals of aggregations like avg, max, min, uniq, count, and all the other aggregate functions in ClickHouse.
Follow us |
| Markdown | [](https://clickhouse.com/)
Copy logo as SVG
[Download full logo](https://clickhouse.com/brand-assets/clickhouse-logo.zip)[Download logomark](https://clickhouse.com/brand-assets/clickhouse-logomark.zip)
Open search
Open region selector
- [English](https://clickhouse.com/?country=en)
- [Japanese](https://clickhouse.com/jp?country=jp)
Open menu
- [Products](https://clickhouse.com/videos/[slug])
**Products**
- [ClickHouse Cloud The best way to use ClickHouse. Available on AWS, GCP, and Azure.](https://clickhouse.com/cloud)
- [Bring Your Own Cloud A fully managed ClickHouse service, deployed in your own AWS, GCP, or Azure account.](https://clickhouse.com/cloud/bring-your-own-cloud)
- [Postgres managed by ClickHouse Unified data stack for transactions and analytics.](https://clickhouse.com/cloud/postgres)
- [Managed ClickStack Managed observability with high-performance queries and long-term retention.](https://clickhouse.com/cloud/clickstack)
- [Langfuse Cloud LLM observability and evaluations for reliable AI applications and agents.](https://langfuse.com/?utm_source=clickhouse_topnav)
**Open source**
- [ClickHouse Fast open-source OLAP database for real-time analytics.](https://clickhouse.com/clickhouse)
- [ClickStack Open-source observability stack for logs, metrics, traces, and session replays.](https://clickhouse.com/clickstack)
- [Agentic Data Stack Build AI-powered applications with ClickHouse.](https://clickhouse.com/ai)
- [chDB In-process SQL Engine powered by ClickHouse, with a Pandas-compatible API](https://clickhouse.com/chdb)
- [Solutions](https://clickhouse.com/videos/[slug])
**Use cases**
- [Real-time analytics](https://clickhouse.com/use-cases/real-time-analytics)
- [Observability](https://clickhouse.com/cloud/clickstack)
- [Data warehousing](https://clickhouse.com/use-cases/data-warehousing)
- [Machine learning and GenAI](https://clickhouse.com/use-cases/machine-learning-and-data-science)
- [All use cases](https://clickhouse.com/use-cases)
[All use cases \-\>\-\>](https://clickhouse.com/use-cases)
**Industries**
- [Cybersecurity](https://clickhouse.com/industries/cybersecurity)
- [Gaming and entertainment](https://clickhouse.com/industries/gaming)
- [E-commerce and retail](https://clickhouse.com/industries/retail)
- [Automotive](https://clickhouse.com/industries/automotive)
- [Energy](https://clickhouse.com/industries/energy)
- [All industries](https://clickhouse.com/industries)
[All industries \-\>\-\>](https://clickhouse.com/industries)
- [Docs](https://clickhouse.com/docs)
- [Resources](https://clickhouse.com/videos/[slug])
- [User stories](https://clickhouse.com/user-stories)
- [Blog](https://clickhouse.com/blog)
- [Events](https://clickhouse.com/company/events)
- [News](https://clickhouse.com/company/news)
- [Learning and certification](https://clickhouse.com/learn)
- [Comparisons](https://clickhouse.com/videos/how-to-compute-running-aggregation-in-clickhouse)
- [Benchmark hub](https://clickhouse.com/benchmarks)
- [BigQuery](https://clickhouse.com/comparison/bigquery)
- [PostgreSQL](https://clickhouse.com/comparison/postgresql)
- [Redshift](https://clickhouse.com/comparison/redshift)
- [Snowflake](https://clickhouse.com/comparison/snowflake)
- [Elastic Observability](https://clickhouse.com/comparison/elastic-for-observability)
- [Splunk](https://clickhouse.com/comparison/splunk-for-observability)
- [OpenSearch For observability](https://clickhouse.com/comparison/opensearch-for-observability)
- [Videos](https://clickhouse.com/videos)
- [Demos](https://clickhouse.com/demos)
- [Pricing](https://clickhouse.com/pricing)
- [Contact us](https://clickhouse.com/company/contact?loc=nav)
Open search
Open region selector
- [English](https://clickhouse.com/?country=en)
- [Japanese](https://clickhouse.com/jp?country=jp)
[46\.9k](https://github.com/ClickHouse/ClickHouse?utm_source=clickhouse&utm_medium=website&utm_campaign=website-nav)
[Sign in](https://console.clickhouse.cloud/signIn?glxid=26aa454a-718f-4a9a-a193-1cce52e4a752&pagePath=%2Fvideos%2Fhow-to-compute-running-aggregation-in-clickhouse&origPath=%2Fvideos%2Fhow-to-compute-running-aggregation-in-clickhouse)
[Get started](https://console.clickhouse.cloud/signUp?loc=nav-get-started&glxid=26aa454a-718f-4a9a-a193-1cce52e4a752&pagePath=%2Fvideos%2Fhow-to-compute-running-aggregation-in-clickhouse&origPath=%2Fvideos%2Fhow-to-compute-running-aggregation-in-clickhouse)
- [Videos](https://clickhouse.com/videos)
- /
- [How to](https://clickhouse.com/videos?category=how-to)
# How to Compute a Running Aggregation in ClickHouse
[**Previous video**Scaling ClickHouse to petabytes of logs at OpenAI](https://clickhouse.com/videos/openai)
[**Next video**ClickHouse Cloud Live Update - February 2024](https://clickhouse.com/videos/clickhouse-cloud-update-call-feb2024)
## Rich Raposa Director, Global Learning, ClickHouse
Using aggregate functions in a materialized view in ClickHouse can lead to surprising results if you don't define them properly. The AggregatingMergeTree table engine requires special column types for representing and storing intermediate (running) totals of aggregations like avg, max, min, uniq, count, and all the other aggregate functions in ClickHouse.
## Recent videos
[View all Videos](https://clickhouse.com/videos)
[ How to CDC ClickPipes: The Fastest Way to Replicate Your Database to ClickHouse Marta Paes, Senior Product Manager at ClickHouse](https://clickhouse.com/videos/202602-APJ-Webinar-CDC-ClickPipes)
[ How to Under-the-Hood: ClickHouse Incremental Materialized Views and Dictionaries Maruthi Lokanathan, Solution Architect at ClickHouse Derek Chia, Principal TAM Architect at ClickHouse](https://clickhouse.com/videos/202601-APJ-Webinar-Materialized-Views)
[ ClickHouse Cloud, How to LogHouse, Observability for ClickHouse Cloud Get an insider’s look at LogHouse, the ClickHouse-powered logging platform that drives observability for ClickHouse Cloud.](https://clickhouse.com/videos/loghouse-observability-for-clickhouse-cloud)
Follow us
[X](https://x.com/ClickhouseDB "X")[Bluesky](https://bsky.app/profile/clickhouse.com "Bluesky")[Slack](https://clickhouse.com/slack "Slack")
[GitHub](https://github.com/ClickHouse/ClickHouse "GitHub")[Telegram](https://telegram.me/clickhouse_en "Telegram")[Meetup](https://www.meetup.com/pro/clickhouse "Meetup")
[Rss](https://clickhouse.com/rss.xml "Rss")
- - Product
- [ClickHouse Cloud](https://clickhouse.com/cloud)
- [Bring Your Own Cloud](https://clickhouse.com/cloud/bring-your-own-cloud)
- [Postgres managed by ClickHouse](https://clickhouse.com/cloud/postgres)
- [Managed ClickStack](https://clickhouse.com/cloud/clickstack)
- [ClickHouse](https://clickhouse.com/clickhouse)
- [ClickStack](https://clickhouse.com/clickstack)
- [Agentic Data Stack](https://clickhouse.com/ai)
- [ClickHouse Government](https://clickhouse.com/government)
- [ClickHouse Keeper](https://clickhouse.com/clickhouse/keeper)
- [ClickPipes](https://clickhouse.com/cloud/clickpipes)
- [Integrations](https://clickhouse.com/integrations)
- [chDB](https://clickhouse.com/chdb)
- [Pricing](https://clickhouse.com/pricing)
- - Resources
- [Documentation](https://clickhouse.com/docs)
- [Trust center](https://trust.clickhouse.com/)
- [Training](https://clickhouse.com/learn)
- [Support](https://clickhouse.com/support/program)
- [Benchmarks](https://clickhouse.com/benchmarks)
- [Use cases](https://clickhouse.com/use-cases)
- [Videos](https://clickhouse.com/videos)
- [Demos](https://clickhouse.com/demos)
- [Presentations](https://presentations.clickhouse.com/)
- [Real-time data warehouse](https://clickhouse.com/real-time-data-warehouse)
- [ClickHouse for data lakes](https://clickhouse.com/clickhouse-for-data-lakes)
- [Engineering resources](https://clickhouse.com/resources/engineering)
- - Company
- [Blog](https://clickhouse.com/blog)
- [Our story](https://clickhouse.com/company/our-story)
- [Careers](https://clickhouse.com/company/careers)
- [Contact us](https://clickhouse.com/company/contact?loc=footer)
- [Events](https://clickhouse.com/company/events)
- [News](https://clickhouse.com/company/news)
- [Media](https://clickhouse.com/media)
- - Join our community
- [ClickHouse Community](https://clickhouse.com/community)
- [GitHub](https://github.com/ClickHouse/ClickHouse)
- [Slack](https://clickhouse.com/slack)
- [LinkedIn](https://www.linkedin.com/company/clickhouseinc)
- [X](https://x.com/ClickhouseDB)
- [Bluesky](https://bsky.app/profile/clickhouse.com)
- [Telegram](https://telegram.me/clickhouse_en)
- [Meetup](https://www.meetup.com/pro/clickhouse)
- - Comparisons
- [BigQuery](https://clickhouse.com/comparison/bigquery)
- [PostgreSQL](https://clickhouse.com/comparison/postgresql)
- [Redshift](https://clickhouse.com/comparison/redshift)
- [Snowflake](https://clickhouse.com/comparison/snowflake)
- [Elastic](https://clickhouse.com/comparison/elastic-for-observability)
- [Splunk](https://clickhouse.com/comparison/splunk-for-observability)
- [OpenSearch](https://clickhouse.com/comparison/opensearch-for-observability)
- Partners
- [AWS](https://clickhouse.com/partners/aws)
- [Azure](https://clickhouse.com/partners/azure)

Stay informed on feature releases, product roadmap, support, and cloud offerings\!
Loading form...
[Star us on Github](https://github.com/ClickHouse/ClickHouse)
© 2026 ClickHouse, Inc. HQ in the Bay Area, CA and Amsterdam, NL.
[Trademark](https://clickhouse.com/legal/trademark-policy)[Privacy](https://clickhouse.com/legal/privacy-policy)[Security](https://trust.clickhouse.com/)[Legal](https://clickhouse.com/legal)[Cookie policy](https://clickhouse.com/legal/cookie-policy)
Your privacy choices
 |
| Readable Markdown | ## Rich Raposa Director, Global Learning, ClickHouse
Using aggregate functions in a materialized view in ClickHouse can lead to surprising results if you don't define them properly. The AggregatingMergeTree table engine requires special column types for representing and storing intermediate (running) totals of aggregations like avg, max, min, uniq, count, and all the other aggregate functions in ClickHouse.
Follow us |
| Shard | 89 (laksa) |
| Root Hash | 12633450985039531489 |
| Unparsed URL | com,clickhouse!/videos/how-to-compute-running-aggregation-in-clickhouse s443 |