---
title: "A Hybrid Query Execution Experiment"
description: "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."
url: "https://swe.quest/articles/a-hybrid-query-execution-experiment-6268c36fd6767e98"
canonical: "https://clickhouse.com/blog/hybrid-query-execution-experiment"
source: "ClickHouse"
published: "2024-01-31"
difficulty: "medium"
kind: "How-to"
reading_minutes: 10
tags: ["analytics","query-engines","sql"]
---

# A Hybrid Query Execution Experiment

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2024-01-31, 10 min read, How-to. Original: [https://clickhouse.com/blog/hybrid-query-execution-experiment](https://clickhouse.com/blog/hybrid-query-execution-experiment)

## Summary

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.

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)
- [SQL](https://swe.quest/tags/sql.md) (Languages)

## Prerequisites

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

## Keywords

ClickHouse, ClickHouse Local, ClickHouse Cloud, remoteSecure, ClickPy, PyPI, GitHub API

## Related posts

- [Extracting, Converting, and Querying Data in Local Files using clickhouse-local](https://swe.quest/articles/extracting-converting-and-querying-data-in-local-files-using-clickhouse-local-46ff61f0273cc3b7.md): ClickHouse · 2023-01-04 · Medium · 13 min read · Analytics & OLAP, SQL, Data pipelines, Developer tools
  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.
- [The world’s fastest tool for querying JSON files](https://swe.quest/articles/the-world-s-fastest-tool-for-querying-json-files-5bf7115ac2686d02.md): ClickHouse · 2022-10-14 · Easy · 3 min read · Performance engineering, Analytics & OLAP, SQL
  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.
- [HIFI’s migration from BigQuery to ClickHouse](https://swe.quest/articles/hifi-s-migration-from-bigquery-to-clickhouse-5318550bbb72f66e.md): ClickHouse · 2023-01-09 · Medium · 8 min read · Analytics & OLAP, SQL, Databases, JavaScript
  HIFI moved music royalty analytics from BigQuery to ClickHouse because BigQuery's per-query pricing discouraged exploratory use and slot reservations didn't fit a startup's shifting workloads.
- [How LINE MANGA used ClickHouse to enable real-time analysis without moving a single row](https://swe.quest/articles/how-line-manga-used-clickhouse-to-enable-real-time-analysis-without-moving-a-542da6f6b53d1c64.md): ClickHouse · 2025-06-16 · Easy · 5 min read · Analytics & OLAP, MySQL, Distributed databases, Developer productivity
  LINE MANGA uses ClickHouse as a federated query layer over its horizontally and vertically sharded MySQL fleet, querying data in place rather than ingesting it.
- [ClickHouse is data lake ready](https://swe.quest/articles/clickhouse-is-data-lake-ready-bebd3b2969b76478.md): ClickHouse · 2026-03-25 · Medium · 13 min read · Analytics & OLAP, Data pipelines, SQL, Query engines
  ClickHouse now queries Apache Iceberg and Delta Lake tables in place on S3, GCS and Azure, either directly or through catalogs such as AWS Glue, Unity, Polaris, BigLake, OneLake and Iceberg REST.

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)
