2020-04-08 14:22:25 +00:00
|
|
|
|
---
|
2022-08-26 19:07:59 +00:00
|
|
|
|
slug: /zh/engines/database-engines/lazy
|
2022-04-10 23:08:18 +00:00
|
|
|
|
sidebar_position: 31
|
|
|
|
|
sidebar_label: 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-->
|