---
title: "ClickHouse projections now behave like true secondary indexes"
description: "ClickHouse lightweight projections, which store only a sorting key plus a _part_offset pointer into the base table, now act as true secondary indexes with granule-level pruning instead of only pruning whole parts."
url: "https://swe.quest/articles/clickhouse-projections-now-behave-like-true-secondary-indexes-0baa9f93cd285ce3"
canonical: "https://clickhouse.com/blog/projections-secondary-indices"
source: "ClickHouse"
published: "2026-01-13"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 6
tags: ["analytics","query-engines","storage-engines","performance"]
---

# ClickHouse projections now behave like true secondary indexes

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2026-01-13, 6 min read, Deep dive. Original: [https://clickhouse.com/blog/projections-secondary-indices](https://clickhouse.com/blog/projections-secondary-indices)

## Summary

ClickHouse lightweight projections, which store only a sorting key plus a \_part\_offset pointer into the base table, now act as true secondary indexes with granule-level pruning instead of only pruning whole parts. Several such projections can combine with each other and with the base table's primary index to narrow the granules a query reads. On the UK price paid dataset, a query filtering on date and town dropped from a 30.7M-row full scan in 0.077 s to about 16k rows in 0.010 s, and EXPLAIN shows both projection indexes pruning granules in turn. Two new settings gate when projection indexes are used, and 26.1 adds a compact \`PROJECTION ... INDEX col TYPE basic\` syntax.

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)
- [Query engines](https://swe.quest/tags/query-engines.md) (Data & databases)
- [Storage engines](https://swe.quest/tags/storage-engines.md) (Data & databases)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)

## Prerequisites

- ClickHouse MergeTree tables ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))
- sparse primary indexes
- SQL ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))

## Keywords

ClickHouse, MergeTree, projections, \_part\_offset, secondary indexes, granule pruning

## Related posts

- [Super charging your ClickHouse queries](https://swe.quest/articles/super-charging-your-clickhouse-queries-55ad4f3a6c2fa875.md): ClickHouse · 2022-12-15 · Medium · 15 min read · Analytics & OLAP, Performance engineering, Query engines, SQL
  ClickHouse query speed comes mainly from reading less data: a sparse primary index stores one entry per 8192-row granule and lets binary search skip blocks that can't match the WHERE clause.
- [Index-based pruning in ClickHouse](https://swe.quest/articles/index-based-pruning-in-clickhouse-5952b67ba993450d.md): ClickHouse · 2026-04-15 · Medium · 21 min read · Analytics & OLAP, Query engines, Storage engines, Performance engineering
  ClickHouse offers three index-based ways to skip data: the sparse primary index (one entry per 8,192-row granule), lightweight projections that store only a sort key plus a \_part\_offset pointer into the base table, and skip indexes such as minmax that keep per-granule min/max values.
- [How ClickHouse makes Top-N queries faster with granule-level data skipping](https://swe.quest/articles/how-clickhouse-makes-top-n-queries-faster-with-granule-level-data-skipping-c5fa6e048ea4d950.md): ClickHouse · 2026-01-19 · Medium · 9 min read · Query engines, Analytics & OLAP, Performance engineering, Databases
  ClickHouse can now use minmax data-skipping indexes to prune whole granules for ORDER BY … LIMIT N queries before reading any rows.
- [ClickHouse Release 25.6](https://swe.quest/articles/clickhouse-release-25-6-783d976caa8e5340.md): ClickHouse · 2025-07-02 · Medium · 12 min read · Analytics & OLAP, Query engines, Storage engines, Consistency models
  ClickHouse 25.6 (25 features, 32 performance optimizations, 105 bug fixes) can take a single consistent storage snapshot across all subqueries and CTEs in a SELECT, controlled by enable\_shared\_storage\_snapshot\_in\_query.
- [ClickHouse Newsletter May 2022: Explain Statement – Query Optimization](https://swe.quest/articles/clickhouse-newsletter-may-2022-explain-statement-query-optimization-a636e0c953208fbf.md): ClickHouse · 2022-05-09 · Medium · 8 min read · Query engines, Analytics & OLAP, Performance engineering, SQL
  ClickHouse's May 2022 newsletter centers on using EXPLAIN for query optimization.

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)
