2020-04-08 14:22:25 +00:00
|
|
|
|
---
|
|
|
|
|
toc_priority: 31
|
2021-08-25 03:51:43 +00:00
|
|
|
|
toc_title: Lazy
|
2020-04-08 14:22:25 +00:00
|
|
|
|
---
|
|
|
|
|
|
2021-08-25 03:51:43 +00:00
|
|
|
|
# Lazy {#lazy}
|
2020-04-08 14:22:25 +00:00
|
|
|
|
|
2021-08-25 03:51:43 +00:00
|
|
|
|
在最后一次访问之后,只在RAM中保存`expiration_time_in_seconds`秒。只能用于\*Log表。
|
2020-04-08 14:22:25 +00:00
|
|
|
|
|
2021-08-25 03:51:43 +00:00
|
|
|
|
它是为存储许多小的\*Log表而优化的,对于这些表,访问之间有很长的时间间隔。
|
2020-04-08 14:22:25 +00:00
|
|
|
|
|
|
|
|
|
## 创建数据库 {#creating-a-database}
|
|
|
|
|
|
2021-08-25 03:51:43 +00:00
|
|
|
|
``` sql
|
|
|
|
|
CREATE DATABASE testlazy ENGINE = Lazy(expiration_time_in_seconds);
|
|
|
|
|
```
|
2020-04-08 14:22:25 +00:00
|
|
|
|
|
2021-09-19 20:05:54 +00:00
|
|
|
|
[来源文章](https://clickhouse.com/docs/en/database_engines/lazy/) <!--hide-->
|