ClickhouseAnnouncement
Introducing chdb Postgres extension: High-performance imports from cloud storage
Summary
The new chdb Postgres extension uses the chDB library, an in-process ClickHouse engine, to import and export data between Postgres and files on cloud storage. In benchmarks using the one-million-row NYC Taxi dataset, chdb ran on four-vCPU, 32-GB ClickHouse Managed Postgres instances and showed the most consistent performance; pg_duckdb and pg_lake took about two to three times longer for CSV, JSON, and Parquet, while aws_s3 supported fewer formats. Its chdb_query() function executes chDB queries, while chdb_hook integrates with COPY for AWS S3, Google Cloud Storage, Azure Blob Storage, local files, and HTTP URLs, with wildcard expansion for multiple files. The extension launches a separate helper application on demand and exchanges ClickHouse Native results through file descriptors, limiting resource use and isolating the PostgreSQL cluster.
Context
Postgres users need efficient, flexible ways to import and export data in many formats from cloud storage. The source compares chdb with aws_s3, pg_duckdb, and pg_lake, noting differences in performance, supported formats, and resource management.
Approach / What changed
chdb provides chdb_query() for executing chDB queries, while chdb_hook connects COPY to AWS S3, Google Cloud Storage, Azure Blob Storage, local files, HTTP URLs, and wildcard-based file sets. A separate helper application embeds chDB and communicates with the PostgreSQL backend through file descriptors and ClickHouse Native results.
Takeaways
chdb supports formats including TSV, CSV, JSON, BSON, Prometheus, Protobuf, Avro, Parquet, Arrow, XML, CapnProto, Markdown, MsgPack, and ORC, along with gzip, zstd, lz4, bz2, snappy, and brotli compression.
In the NYC Taxi benchmark, pg_duckdb and pg_lake took about two to three times longer than chdb for CSV, JSON, and Parquet imports; aws_s3 approached chdb's performance but supported fewer formats.
The helper application starts on demand, communicates through STDIN, STDOUT, STDERR, and a configuration file descriptor, then exits after passing results to the PostgreSQL backend.
Source and freshness
- Source
- clickhouse.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.