The world’s fastest tool for querying JSON files
clickhouse-local, a single-binary SQL engine for local and remote files, outperforms SPySQL, jq, trdsql, Miller, OctoSQL, spark-sql, Pandas and DSQ when querying large JSON files in the SPySQL benchmark on Amazon book reviews data. The benchmark covers map (computed column over all rows), aggregation (column average) and filter (first 100 matching rows) tasks, and OctoSQL is faster on smaller files. Schema inference and semi-structured data support make the queries simple to write. Caveats: each query runs only once, results vary by hardware, and the filter test favors tools that stop early on LIMIT without loading the whole file.
Related posts
- The billion docs JSON Challenge: ClickHouse vs. MongoDB, Elasticsearch, and more
ClickHouse mediumAdept
JSONBench is a reproducible benchmark that loads up to one billion Bluesky event JSON documents into ClickHouse, MongoDB, Elasticsearch, DuckDB and PostgreSQL, then measures storage size and the speed of five analytical queries. ClickHouse's columnar JSON type stores each JSON path as a separate compressed column. In these tests it used 40% less storage and ran aggregations 2500x faster than MongoDB, used half the storage and ran 10x faster than Elasticsearch, and was several thousand times faster than DuckDB and PostgreSQL while using 5-6x less disk. The write-up explains each system's JSON storage model, compression, sorting, indexes and caches, and how each was configured for a fair comparison, such as MongoDB covered index scans and Elasticsearch with _source disabled.
- Extracting, Converting, and Querying Data in Local Files using clickhouse-local
ClickHouse mediumAdept
clickhouse-local runs ClickHouse's SQL engine as a standalone CLI, so you can query, transform and convert local, piped, HTTP, S3, MySQL or Postgres data without deploying a server. Worked examples cover querying CSVs with or without headers via the file() function, schema inference with DESCRIBE, and writing results with INTO OUTFILE in formats such as SQLInsert and Parquet. They also show globbing and joining multiple files, the virtual _file/_path columns, and stdin piping with --structure. Compressed multi-gigabyte files are handled with automatic compression detection, and a 826K CSV shrinks to 432K as Parquet.
- What really matters for performance: lessons from a year of benchmarks
ClickHouse easyNovice
Six ClickHouse benchmarks from 2025 point to one conclusion: performance depends on how efficiently an engine moves data end-to-end. JSONBench showed columnar JSON storage running orders of magnitude faster than document stores like MongoDB on up to 1B Bluesky events. FastFormats found the Native format, LZ4 compression and large batches matter most for ingestion, and Netflix used those results to reach ~5 PB/day of log ingestion. A distributed cache matched or beat local SSDs on object storage, lightweight SQL UPDATEs ran up to 1,000× faster than mutations, and parallel replicas aggregated 100B rows in ~0.4s.
- A Hybrid Query Execution Experiment
ClickHouse mediumAdept
ClickHouse Local can join local JSON files of GitHub repository metrics with PyPI download data on a remote ClickHouse Cloud server via the remoteSecure table function, giving a form of hybrid query execution. Joins confined to remote tables are pushed down to the server (EXPLAIN PLAN shows ReadFromRemote), but mixing in local data streams the remote join result to the client, taking about 4 seconds. When sorting by a remote column, limiting the remote subquery cuts the data transferred and speeds the query up. Setup requires a user granted CREATE TEMPORARY TABLE and REMOTE permissions, and the workflow is presented as an experiment rather than an optimized use case.
- What's New in pg_clickhouse - JSONB Support, SQL value functions, Streaming, and more
ClickHouse mediumAdept
pg_clickhouse, the Postgres foreign data wrapper for querying ClickHouse, now pushes down far more operations to ClickHouse. JSONB accessors (->, ->>, jsonb_extract_path) are translated to ClickHouse sub-column syntax. CURRENT_DATE, CURRENT_TIMESTAMP and clock_timestamp() are translated to ClickHouse now()/now64()/nowInBlock64 calls that use the Postgres session time zone and timestamp precision. Array functions now map to their ClickHouse equivalents. Streaming of HTTP driver results in roughly 50MB batches kept container memory under about 100MiB during a full NYC taxi table scan, versus about 600MiB without it.