<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/pg-clickhouse-v0-10-subquery-pushdown-and-1000x-faster-tpc-h-queries-t4gtgjfr1" -->

---
title: pg_clickhouse v0.10: Subquery pushdown and 1000x faster...
description: pg_clickhouse v0.10.0 advances TPC-H pushdown coverage from 12 to 16 of 22 queries, with the headline win being Q17 (a correlated subquery) dropping from 32.7...
canonical: https://daily.dev/posts/pg-clickhouse-v0-10-subquery-pushdown-and-1000x-faster-tpc-h-queries-t4gtgjfr1
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: pg_clickhouse v0.10: Subquery pushdown and 1000x faster TPC-H queries | daily.dev
og:description: pg_clickhouse v0.10.0 advances TPC-H pushdown coverage from 12 to 16 of 22 queries, with the headline win being Q17 (a correlated subquery) dropping from 32.7...
og:url: https://daily.dev/posts/pg-clickhouse-v0-10-subquery-pushdown-and-1000x-faster-tpc-h-queries-t4gtgjfr1
og:image: https://api.daily.dev/og/posts/T4GtGJfR1.png
og:image:alt: pg_clickhouse v0.10: Subquery pushdown and 1000x faster TPC-H queries
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# pg_clickhouse v0.10: Subquery pushdown and 1000x faster TPC-H queries

**[Hacker News](https://daily.dev/sources/hn)** · 13 min read · 18 upvotes · 0 comments

## Summary

pg_clickhouse v0.10.0 advances TPC-H pushdown coverage from 12 to 16 of 22 queries, with the headline win being Q17 (a correlated subquery) dropping from 32.7 seconds to 37 milliseconds. Key changes include full SubPlan pushdown so Postgres subqueries become ClickHouse subqueries, a corrected NOT IN implementation that handles three-valued vs two-valued NULL logic, a rebuilt C driver (clickhouse-c) replacing the C++ clickhouse-cpp to eliminate crash-prone exception/setjmp interactions and reduce memory use, HTTP driver now using Native binary format, explicit compression and TLS controls, multidimensional array support, concurrency bug fixes for concurrent foreign scans, and new utility functions clickhouse_query(), clickhouse_perform(), and clickhouse_server_version(). Builtin function pushdown is opt-in since v0.3.0 to prevent silent semantic mismatches. Subquery pushdown requires ClickHouse 25.8 or newer.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://clickhouse.com/blog/pg_clickhouse-whats-new-july-2026>

## Questions this post answers

### What's new in pg_clickhouse version 0.10.0?

Version 0.10.0 adds full pushdown support for correlated subqueries and the NOT IN/IN operator family, raising the number of fully pushed-down TPC-H queries from 12 to 16 out of 22. It also rebuilds the binary driver on a new clickhouse-c client library, adds partitionwise aggregation, TLS and compression driver options, and new clickhouse_query and clickhouse_perform functions, while deprecating clickhouse_raw_query and the HTTP driver's fetch_size setting.

_Teams optimizing Postgres-to-ClickHouse analytics can track pushdown coverage changes like these on daily.dev._

### Why does pg_clickhouse need special handling for NOT IN with NULL values?

ClickHouse's IN operator uses two-valued logic while PostgreSQL uses three-valued logic, so naively pushing down NOT IN can silently invert results whenever NULL is involved, causing WHERE NOT IN to return rows PostgreSQL would filter out. pg_clickhouse 0.10.0 fixes this by injecting CASE-based guards only when it cannot prove operands are non-nullable, and disables the transform_null_in server setting to prevent ClickHouse from changing IN's null semantics.

_Developers debugging subtle NULL-handling bugs in Postgres-ClickHouse pushdown can follow fixes like this on daily.dev._

### What minimum ClickHouse version is required for correlated subquery pushdown in pg_clickhouse?

Correlated subquery pushdown requires ClickHouse 25.8 or later, since that version introduced support for the correlated-subquery SQL shape pg_clickhouse generates. On older ClickHouse servers, pg_clickhouse checks the server version at plan time and automatically falls back to local evaluation instead of pushing the subquery down.

_Engineers upgrading ClickHouse deployments to unlock new pushdown features can track version requirements like this on daily.dev._

## Similar posts on daily.dev

- [What's New in pg\_clickhouse - JSONB Support, SQL value functions, Streaming, and more](https://daily.dev/posts/what-s-new-in-pg-clickhouse---jsonb-support-sql-value-functions-streaming-and-more-go94bydw3) · ClickHouse · 31 upvotes · 1 comments
- [pg\_clickhouse 0.3.1: Now With More C](https://daily.dev/posts/pg-clickhouse-0-3-1-now-with-more-c-h3naoiqtg) · Planet PostgreSQL · 1 upvotes · 0 comments
- [Introducing pg\_clickhouse: A Postgres extension for querying ClickHouse](https://daily.dev/posts/introducing-pg-clickhouse-a-postgres-extension-for-querying-clickhouse-s9p7k0xdv) · ClickHouse · 35 upvotes · 4 comments
- [What's New in pg\_clickhouse v0.3.2: Postgres 19, TLS, Regex, and Memory](https://daily.dev/posts/what-s-new-in-pg-clickhouse-v0-3-2-postgres-19-tls-regex-and-memory-bsqvivpr0) · ClickHouse · 18 upvotes · 1 comments

---

Tags: [#backend](https://daily.dev/tags/backend), [#postgresql](https://daily.dev/tags/postgresql), [#clickhouse](https://daily.dev/tags/clickhouse)

[View this post on daily.dev](https://daily.dev/posts/pg-clickhouse-v0-10-subquery-pushdown-and-1000x-faster-tpc-h-queries-t4gtgjfr1)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"pg_clickhouse v0.10: Subquery pushdown and 1000x faster TPC-H queries","url":"https://daily.dev/posts/pg-clickhouse-v0-10-subquery-pushdown-and-1000x-faster-tpc-h-queries-t4gtgjfr1","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/pg-clickhouse-v0-10-subquery-pushdown-and-1000x-faster-tpc-h-queries-t4gtgjfr1"},"datePublished":"2026-08-12T02:59:58.295Z","dateModified":"2026-09-13T21:46:11.915Z","description":"pg_clickhouse v0.10.0 advances TPC-H pushdown coverage from 12 to 16 of 22 queries, with the headline win being Q17 (a correlated subquery) dropping from 32.7...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/956ca8c360822a3975abfd7f9ddbe28b?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/956ca8c360822a3975abfd7f9ddbe28b?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Hacker News","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Hacker News","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/hn","url":"https://daily.dev/sources/hn"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/pg-clickhouse-v0-10-subquery-pushdown-and-1000x-faster-tpc-h-queries-t4gtgjfr1","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":18},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"backend,postgresql,clickhouse","timeRequired":"PT13M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Hacker News","item":"https://daily.dev/sources/hn"},{"@type":"ListItem","position":3,"name":"pg_clickhouse v0.10: Subquery pushdown and 1000x faster TPC-H queries"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/pg-clickhouse-v0-10-subquery-pushdown-and-1000x-faster-tpc-h-queries-t4gtgjfr1#faq","mainEntity":[{"@type":"Question","name":"What's new in pg_clickhouse version 0.10.0?","acceptedAnswer":{"@type":"Answer","text":"Version 0.10.0 adds full pushdown support for correlated subqueries and the NOT IN/IN operator family, raising the number of fully pushed-down TPC-H queries from 12 to 16 out of 22. It also rebuilds the binary driver on a new clickhouse-c client library, adds partitionwise aggregation, TLS and compression driver options, and new clickhouse_query and clickhouse_perform functions, while deprecating clickhouse_raw_query and the HTTP driver's fetch_size setting. Teams optimizing Postgres-to-ClickHouse analytics can track pushdown coverage changes like these on daily.dev."}},{"@type":"Question","name":"Why does pg_clickhouse need special handling for NOT IN with NULL values?","acceptedAnswer":{"@type":"Answer","text":"ClickHouse's IN operator uses two-valued logic while PostgreSQL uses three-valued logic, so naively pushing down NOT IN can silently invert results whenever NULL is involved, causing WHERE NOT IN to return rows PostgreSQL would filter out. pg_clickhouse 0.10.0 fixes this by injecting CASE-based guards only when it cannot prove operands are non-nullable, and disables the transform_null_in server setting to prevent ClickHouse from changing IN's null semantics. Developers debugging subtle NULL-handling bugs in Postgres-ClickHouse pushdown can follow fixes like this on daily.dev."}},{"@type":"Question","name":"What minimum ClickHouse version is required for correlated subquery pushdown in pg_clickhouse?","acceptedAnswer":{"@type":"Answer","text":"Correlated subquery pushdown requires ClickHouse 25.8 or later, since that version introduced support for the correlated-subquery SQL shape pg_clickhouse generates. On older ClickHouse servers, pg_clickhouse checks the server version at plan time and automatically falls back to local evaluation instead of pushing the subquery down. Engineers upgrading ClickHouse deployments to unlock new pushdown features can track version requirements like this on daily.dev."}}]}
```

