2021-11-14 14:32:08 +08:00

28 lines
578 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: "ClickHouse 表引擎之 Set"
date: 2020-10-08T17:04:00+08:00
lastmod: 2020-10-08T17:04:00+08:00
tags: []
categories: ["clickhouse"]
---
# Set 表引擎简介
- 数据先写内存,再同步到磁盘,服务重启后全量加载到内存
- 支持 INSERT写入时重复数据被忽略
- 不能直接 SELECT只能作为 IN 查询的右侧条件
# 创建 Set 引擎表
- 声明
```sql
ENGINE = Set()
```
# 使用
- 创建 Set 引擎表
- INSERT 写入数据
- 查询
```sql
SELECT arrayJoin([1,2,3]) AS a WHERE a IN set_table;
```