clickhouse 中select in操作


https://clickhouse.yandex/docs/en/operations/settings/settings/

distributed_product_mode

Changes the behavior of distributed subqueries.

ClickHouse applies this setting when the query contains the product of distributed tables, i.e. when the query for a distributed table contains a non-GLOBAL subquery for the distributed table.

Restrictions:

  • Only applied for IN and JOIN subqueries.
  • Only if the FROM section uses a distributed table containing more than one shard.
  • If the subquery concerns a distributed table containing more than one shard,
  • Not used for a table-valued remote function.

The possible values are:

  • deny — Default value. Prohibits using these types of subqueries (returns the "Double-distributed in/JOIN subqueries is denied" exception).
  • local — Replaces the database and table in the subquery with local ones for the destination server (shard), leaving the normal IN / JOIN.
  • global — Replaces the IN / JOIN query with GLOBAL IN / GLOBAL JOIN.
  • allow — Allows the use of these types of subqueries.
  • https://blog.csdn.net/ma15732625261/article/details/86607199
  • 分布式子查詢

    帶有子查詢的in

    1、普通in,查詢發送到遠程服務器,且每個服務器中運行in或join子句的子查詢

    2、global in、global join時,先為global in、global join運行所有子查詢,將結果收到臨時表且將表發給每個服務器,使用臨時表運行查詢

    非分布式查詢,使用普通的in、join

    假設集群中每個服務器都存在一個正常表local_table,與分布式表distributed_table

       對distributed_table查詢,查詢被送到服務器且使用local_table運行查詢


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM