---
title: "How Artemis Security runs 69x faster detection queries with ClickHouse Cloud"
description: "Artemis, an AI-native threat detection platform ingesting terabytes of logs daily, sped up its ClickHouse Cloud workload with three techniques."
url: "https://swe.quest/articles/how-artemis-security-runs-69x-faster-detection-queries-with-clickhouse-cloud-9e25fd4724aa15b1"
canonical: "https://clickhouse.com/blog/artemis-security-real-time-threat-detection"
source: "ClickHouse"
published: "2026-07-01"
difficulty: "medium"
kind: "Case study"
reading_minutes: 8
tags: ["analytics","performance","threat-detection","ai-agents","sql"]
---

# How Artemis Security runs 69x faster detection queries with ClickHouse Cloud

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2026-07-01, 8 min read, Case study. Original: [https://clickhouse.com/blog/artemis-security-real-time-threat-detection](https://clickhouse.com/blog/artemis-security-real-time-threat-detection)

## Summary

Artemis, an AI-native threat detection platform ingesting terabytes of logs daily, sped up its ClickHouse Cloud workload with three techniques. Query coalescing merges hundreds of detection-rule predicates into a single scan that tags matching rows with rule IDs, cutting one benchmark from 173s to 2.5s (69x) with 46x less CPU. It relies on a runtime classifier that excludes the roughly 15% of rules using JOINs, CTEs or GROUP BY, plus size-aware batching with a binary-split fallback around max\_query\_size. A Claude Code skill called /poke automates debugging across system tables, metrics and source code. A materialized view extracts hot JSON sub-columns into native types and feeds a two-step filter-then-fetch query pattern, making investigative queries 30-60x faster with up to 400x lower CPU.

Written by swe.quest, not by the author.

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

## Topics

- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Threat detection](https://swe.quest/tags/threat-detection.md) (Security)
- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [SQL](https://swe.quest/tags/sql.md) (Languages)

## Prerequisites

- ClickHouse basics ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))
- SQL ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))
- materialized views

## Keywords

ClickHouse Cloud, Artemis, SharedMergeTree, Claude Code, ARRAY JOIN, CloudTrail

## Related posts

- [How Exabeam uses ClickHouse for scalable, searchable security analytics](https://swe.quest/articles/how-exabeam-uses-clickhouse-for-scalable-searchable-security-analytics-9b3f4c0a732d0875.md): ClickHouse · 2025-09-11 · Medium · 6 min read · Analytics & OLAP, Performance engineering, Threat detection, Data pipelines, Scaling
  Exabeam runs its security analytics platform on ClickHouse Cloud across 10 regions, ingesting up to 1.2M events/sec per region (80B+ daily, 3.5 PB raw compressed to 200 TiB), with compute-compute separation that isolates write, merge and read nodes.
- [Intelligent security at ClickHouse speed: How Cogent Security built an AI-native vulnerability management platform](https://swe.quest/articles/intelligent-security-at-clickhouse-speed-how-cogent-security-built-an-ai-native-1f3815ca47a60230.md): ClickHouse · 2026-03-24 · Medium · 9 min read · Analytics & OLAP, AI agents, Evaluation, Data pipelines, Performance engineering
  Cogent Security serves billions of vulnerability findings from per-tenant ClickHouse databases fed by a pipeline of entity resolution into a Knowledge Graph, dbt-built denormalized Iceberg tables, and the ClickHouse Spark Connector.
- [Cisco Talos empowers threat researchers while reducing TCO by 75% with ClickHouse Cloud](https://swe.quest/articles/cisco-talos-empowers-threat-researchers-while-reducing-tco-by-75-with-b07e23f1f37bf66e.md): ClickHouse · 2026-06-15 · Medium · 6 min read · Analytics & OLAP, Cloud platforms, Cost optimization, Data pipelines, Threat detection
  Cisco Talos moved its file-hash reputation service, nearly 2 trillion rows (192 TB compressed, ~2 PB raw) growing by 27 billion rows a day, from a self-managed ClickHouse cluster on EKS to ClickHouse Cloud with zero downtime.
- [Why OpenAI chose ClickHouse for petabyte-scale observability](https://swe.quest/articles/why-openai-chose-clickhouse-for-petabyte-scale-observability-dd57167d0fc8c4cb.md): ClickHouse · 2025-06-30 · Medium · 6 min read · Observability, Performance engineering, Analytics & OLAP, Scaling, Data structures
  OpenAI ingests petabytes of logs daily, growing over 20% monthly, into a ClickHouse cluster of 90 shards with two replicas each, fed by Fluent Bit agents.
- [How Mercado Libre rebuilt its observability platform on ClickHouse Cloud with 75x faster trace queries](https://swe.quest/articles/how-mercado-libre-rebuilt-its-observability-platform-on-clickhouse-cloud-with-a3245c05609a41cc.md): ClickHouse · 2026-08-04 · Medium · 8 min read · Observability, Analytics & OLAP, Scaling, Performance engineering
  Mercado Libre moved the storage layer of its OpenTelemetry-based tracing platform, O11y events, to 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)
