当前位置: 首页 > news >正文

Doris入门篇-分区分桶实验

简介

测试分区分桶效果。

分区的基本操作

添加分区

ALTER TABLE v2x_olap_database.government_car
ADD PARTITION p20221203 VALUES LESS THAN ("2022-12-04");

动态分区表不能添加分区,需要转为手动分区表。

查看分区 

show partitions from <表名>

删除分区 

alter table <表名>
drop partition <分区名>

手动分区表与动态分区表切换
手动转自动

alter table <表名> set ("dynamic_partition.enable" = "true")

注意: 如果设置了 dynamic_partition.start ,则分区范围在偏移量之前的历史分区将被删除

自动转手动

alter table <表名> set ("dynamic_partition.enable" = "false")

分区和分桶

Doris 支持两层的数据划分。第一层是 Partition,支持 Range 和 List 的划分方式。第二层是 Bucket(Tablet),仅支持 Hash 的划分方式。

也可以仅使用一层分区。使用一层分区时,只支持 Bucket 划分。下面我们来分别介绍下分区以及分桶:

  1. Partition

    • Partition 列可以指定一列或多列,分区列必须为 KEY 列。多列分区的使用方式在后面 多列分区 小结介绍。
    • 不论分区列是什么类型,在写分区值时,都需要加双引号。
    • 分区数量理论上没有上限。
    • 当不使用 Partition 建表时,系统会自动生成一个和表名同名的,全值范围的 Partition。该 Partition 对用户不可见,并且不可删改。
    • 创建分区时不可添加范围重叠的分区。

    Range 分区

    • 分区列通常为时间列,以方便的管理新旧数据。

    • Partition 支持通过 VALUES LESS THAN (...) 仅指定上界,系统会将前一个分区的上界作为该分区的下界,生成一个左闭右开的区间。也支持通过 VALUES [...) 指定上下界,生成一个左闭右开的区间。

分区

Range Partition

静态 Range Partition

创建表

CREATE TABLE IF NOT EXISTS example_range_tbl
(`user_id` LARGEINT NOT NULL COMMENT "用户id",`date` DATE NOT NULL COMMENT "数据灌入日期时间",`city` VARCHAR(20) COMMENT "用户所在城市",`age` SMALLINT COMMENT "用户年龄",`sex` TINYINT COMMENT "用户性别",`last_visit_date` DATETIME REPLACE DEFAULT "1970-01-01 00:00:00" COMMENT "用户最后一次访问时间",`cost` BIGINT SUM DEFAULT "0" COMMENT "用户总消费",`max_dwell_time` INT MAX DEFAULT "0" COMMENT "用户最大停留时间",`min_dwell_time` INT MIN DEFAULT "99999" COMMENT "用户最小停留时间"
)
ENGINE=OLAP
AGGREGATE KEY(`user_id`, `date`, `city`, `age`, `sex`)
PARTITION BY RANGE(`date`)
(PARTITION `p201701` VALUES LESS THAN ("2017-02-01"),PARTITION `p201702` VALUES LESS THAN ("2017-03-01"),PARTITION `p201703` VALUES LESS THAN ("2017-04-01")
)
DISTRIBUTED BY HASH(`user_id`) BUCKETS 5
PROPERTIES
("replication_num" = "1"
);

容易理解。这里举例说明,当使用 `VALUES LESS THAN (...)` 语句进行分区的增删操作时,分区范围的变化情况:

 - 如上 `example_range_tbl` 示例,当建表完成后,会自动生成如下3个分区:

   ```text

   p201701: [MIN_VALUE,  2017-02-01)

   p201702: [2017-02-01, 2017-03-01)

   p201703: [2017-03-01, 2017-04-01)

   ```

测试插入数据(下面分别插入对应的分区)

insert into example_range_tbl values(10001,'2017-01-05','北京',30,1,'2017-10-01 17:05:45',2,22,22); 
insert into example_range_tbl values(10000,'2017-02-01','北京',20,0,'2017-10-01 06:00:00',20,10,10);
insert into example_range_tbl values(10000,'2017-03-03','北京',20,0,'2017-10-01 07:00:00',15,2,2);

查询创建的分区

SHOW PARTITIONS FROM example_range_tbl;

动态 Range Partition

创建表

CREATE TABLE IF NOT EXISTS example_range_tbl
(`user_id` LARGEINT NOT NULL COMMENT "用户id",`date` DATE NOT NULL COMMENT "数据灌入日期时间",`city` VARCHAR(20) COMMENT "用户所在城市",`age` SMALLINT COMMENT "用户年龄",`sex` TINYINT COMMENT "用户性别",`last_visit_date` DATETIME REPLACE DEFAULT "1970-01-01 00:00:00" COMMENT "用户最后一次访问时间",`cost` BIGINT SUM DEFAULT "0" COMMENT "用户总消费",`max_dwell_time` INT MAX DEFAULT "0" COMMENT "用户最大停留时间",`min_dwell_time` INT MIN DEFAULT "99999" COMMENT "用户最小停留时间"
)
ENGINE=OLAP
AGGREGATE KEY(`user_id`, `date`, `city`, `age`, `sex`)
PARTITION BY RANGE(`date`)()
DISTRIBUTED BY HASH(`user_id`)
PROPERTIES ("replication_allocation" = "tag.location.default: 1", "dynamic_partition.enable" = "true","dynamic_partition.time_unit" = "DAY","dynamic_partition.end" = "3","dynamic_partition.prefix" = "p",  "dynamic_partition.buckets" = "10"	
);

dynamic_partition.enable: 是否开启动态分区特性,可指定为 true 或 false。默认为 true。
dynamic_partition.time_unit: 动态分区调度的单位,可指定为 DAY WEEK MONTH,当指定为 DAY时,动态创建的分区名后缀格式为yyyyMMdd,例如- - 20200325。当指定为 WEEK 时,动态创建的分区名后缀格式为yyyy_ww即当前日期属于这一年的第几周。当指定为 MONTH 时,动态创建的分区名后缀格式为 yyyyMM,例如 202003。
dynamic_partition.start: 动态分区的开始时间, 以当天为基准,超过该时间范围的分区将会被删除。如果不填写,则默认为Integer.MIN_VALUE 即 -2147483648。
dynamic_partition.end: 动态分区的结束时间, 以当天为基准,会提前创建N个单位的分区范围。
dynamic_partition.prefix: 动态创建的分区名前缀。
dynamic_partition.buckets: 动态创建的分区所对应的分桶数量。

查看分区

show partitions from example_range_tbl;
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
| PartitionId | PartitionName | VisibleVersion | VisibleVersionTime  | State  | PartitionKey | Range                                                                      | DistributionKey | Buckets | ReplicationNum | StorageMedium | CooldownTime        | RemoteStoragePolicy | LastConsistencyCheckTime | DataSize | IsInMemory | ReplicaAllocation       |
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
| 12985       | p20230302     | 1              | 2023-03-02 16:47:18 | NORMAL | date         | [types: [DATE]; keys: [2023-03-02]; ..types: [DATE]; keys: [2023-03-03]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13006       | p20230303     | 1              | 2023-03-02 16:47:18 | NORMAL | date         | [types: [DATE]; keys: [2023-03-03]; ..types: [DATE]; keys: [2023-03-04]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13027       | p20230304     | 1              | 2023-03-02 16:47:18 | NORMAL | date         | [types: [DATE]; keys: [2023-03-04]; ..types: [DATE]; keys: [2023-03-05]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13048       | p20230305     | 1              | 2023-03-02 16:47:19 | NORMAL | date         | [types: [DATE]; keys: [2023-03-05]; ..types: [DATE]; keys: [2023-03-06]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
4 rows in set (0.00 sec)

可以看到上面的创建了从今天开始后面的3个分区。

插入历史数据看看 

insert into example_range_tbl values(10001,'2017-01-05','beijing',30,1,'2017-10-01 17:05:45',2,22,22);

上面的操作以后会报错(说明如果没有对应的历史分区,默认是插入不成功的)

[root@doris1 ~]# cat _load_error_log\?file\=__shard_3%2Ferror_log_insert_stmt_75a4a5394a0a4c4a-a813211947164ecc_75a4a5394a0a4c4a_a813211947164ecc 
Reason: no partition for this tuple. tuple=+---------------+---------------+------------------+-----------------+----------------+--------------------+-----------------+-----------------+-----------------+
|(Int128)       |(Date)         |(Nullable(String))|(Nullable(Int16))|(Nullable(Int8))|(Nullable(DateTime))|(Nullable(Int64))|(Nullable(Int32))|(Nullable(Int32))|
+---------------+---------------+------------------+-----------------+----------------+--------------------+-----------------+-----------------+-----------------+
|          10001|     2017-01-05|           beijing|               30|               1| 2017-10-01 17:05:45|                2|               22|               22|
+---------------+---------------+------------------+-----------------+----------------+--------------------+-----------------+-----------------+-----------------+
. src line []; 

开启历史分区 

create_history_partition = true
1)dynamic_partition.history_partition_num 未设置,即 -1;expect_create_partition_num = end - start;
2)dynamic_partition.history_partition_num 已设置 expect_create_partition_num = end - max(start, -histoty_partition_num);
create_history_partition = false 不会创建历史分区,expect_create_partition_num = end - 0;
当 expect_create_partition_num 大于 max_dynamic_partition_num(默认500)时,禁止创建过多分区。
注意:dynamic_partition.start 与 `expect_create_partition_num``如果未设置,则无法创建历史分区

建表语句

CREATE TABLE IF NOT EXISTS example_range_tbl
(`user_id` LARGEINT NOT NULL COMMENT "用户id",`date` DATE NOT NULL COMMENT "数据灌入日期时间",`city` VARCHAR(20) COMMENT "用户所在城市",`age` SMALLINT COMMENT "用户年龄",`sex` TINYINT COMMENT "用户性别",`last_visit_date` DATETIME REPLACE DEFAULT "1970-01-01 00:00:00" COMMENT "用户最后一次访问时间",`cost` BIGINT SUM DEFAULT "0" COMMENT "用户总消费",`max_dwell_time` INT MAX DEFAULT "0" COMMENT "用户最大停留时间",`min_dwell_time` INT MIN DEFAULT "99999" COMMENT "用户最小停留时间"
)
ENGINE=OLAP
AGGREGATE KEY(`user_id`, `date`, `city`, `age`, `sex`)
PARTITION BY RANGE(`date`)()
DISTRIBUTED BY HASH(`user_id`)
PROPERTIES ("replication_allocation" = "tag.location.default: 1", "dynamic_partition.enable" = "true","dynamic_partition.time_unit" = "DAY","dynamic_partition.end" = "5","dynamic_partition.prefix" = "p",  "dynamic_partition.buckets" = "10","dynamic_partition.create_history_partition" = "true","dynamic_partition.start" = "-10"
);

 查看分区

show partitions from example_range_tbl;
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+| PartitionId | PartitionName | VisibleVersion | VisibleVersionTime  | State  | PartitionKey | Range                                                                      | DistributionKey | Buckets | ReplicationNum | StorageMedium | CooldownTime        | RemoteStoragePolicy | LastConsistencyCheckTime | DataSize | IsInMemory | ReplicaAllocation       |+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
| 13071       | p20230220     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-02-20]; ..types: [DATE]; keys: [2023-02-21]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13092       | p20230221     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-02-21]; ..types: [DATE]; keys: [2023-02-22]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13113       | p20230222     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-02-22]; ..types: [DATE]; keys: [2023-02-23]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13134       | p20230223     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-02-23]; ..types: [DATE]; keys: [2023-02-24]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13155       | p20230224     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-02-24]; ..types: [DATE]; keys: [2023-02-25]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13176       | p20230225     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-02-25]; ..types: [DATE]; keys: [2023-02-26]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13197       | p20230226     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-02-26]; ..types: [DATE]; keys: [2023-02-27]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13218       | p20230227     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-02-27]; ..types: [DATE]; keys: [2023-02-28]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13239       | p20230228     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-02-28]; ..types: [DATE]; keys: [2023-03-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13260       | p20230301     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-03-01]; ..types: [DATE]; keys: [2023-03-02]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13281       | p20230302     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-03-02]; ..types: [DATE]; keys: [2023-03-03]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13302       | p20230303     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-03-03]; ..types: [DATE]; keys: [2023-03-04]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13323       | p20230304     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-03-04]; ..types: [DATE]; keys: [2023-03-05]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13344       | p20230305     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-03-05]; ..types: [DATE]; keys: [2023-03-06]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13365       | p20230306     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-03-06]; ..types: [DATE]; keys: [2023-03-07]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13386       | p20230307     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-03-07]; ..types: [DATE]; keys: [2023-03-08]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+

 (注意今天的时间是3月2日,上面创建了未来3天的分区和历史10天的分区)

插入数据测试(如果没有分区还是不能自己创建,历史分区也就是自动的创建之前分区的功能)

insert into example_range_tbl values(10001,'2017-01-05','beijing',30,1,'2017-10-01 17:05:45',2,22,22); 

 下面的数据就能够创建成功

insert into example_range_tbl values(10001,'2023-02-27','beijing',30,1,'2017-10-01 17:05:45',2,22,22); 

批量创建分区 

批量创建分区功能在前期充分调研了用户的需求,本着简洁、强大、易用的设计目标,将设计核心锁定在几个要素中:

  • 时间区间范围(会考虑开闭问题)

  • 时间跨度(即每个分区的时间维度的大小)

  • 时间单位(年、月、日、时、周等)

建表语句

CREATE TABLE IF NOT EXISTS example_range_tbl1
(`user_id` LARGEINT NOT NULL COMMENT "用户id",`date` DATE NOT NULL COMMENT "数据灌入日期时间",`city` VARCHAR(20) COMMENT "用户所在城市",`age` SMALLINT COMMENT "用户年龄",`sex` TINYINT COMMENT "用户性别",`last_visit_date` DATETIME REPLACE DEFAULT "1970-01-01 00:00:00" COMMENT "用户最后一次访问时间",`cost` BIGINT SUM DEFAULT "0" COMMENT "用户总消费",`max_dwell_time` INT MAX DEFAULT "0" COMMENT "用户最大停留时间",`min_dwell_time` INT MIN DEFAULT "99999" COMMENT "用户最小停留时间"
)
ENGINE=OLAP
AGGREGATE KEY(`user_id`, `date`, `city`, `age`, `sex`)
PARTITION BY RANGE(`date`)
(FROM ("2000-01-01") TO ("2021-01-01") INTERVAL 1 YEAR,FROM ("2021-01-01") TO ("2022-01-01") INTERVAL 1 MONTH,FROM ("2022-01-01") TO ("2023-01-01") INTERVAL 1 WEEK,FROM ("2023-01-01") TO ("2023-02-01") INTERVAL 1 DAY
)
DISTRIBUTED BY HASH(`user_id`)
PROPERTIES ("replication_allocation" = "tag.location.default: 1"
);

查看分区数据

mysql> show partitions from example_range_tbl1;
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
| PartitionId | PartitionName | VisibleVersion | VisibleVersionTime  | State  | PartitionKey | Range                                                                      | DistributionKey | Buckets | ReplicationNum | StorageMedium | CooldownTime        | RemoteStoragePolicy | LastConsistencyCheckTime | DataSize | IsInMemory | ReplicaAllocation       |
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
| 13408       | p_2000        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2000-01-01]; ..types: [DATE]; keys: [2001-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13409       | p_2001        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2001-01-01]; ..types: [DATE]; keys: [2002-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13410       | p_2002        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2002-01-01]; ..types: [DATE]; keys: [2003-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13411       | p_2003        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2003-01-01]; ..types: [DATE]; keys: [2004-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13412       | p_2004        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2004-01-01]; ..types: [DATE]; keys: [2005-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13413       | p_2005        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2005-01-01]; ..types: [DATE]; keys: [2006-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13414       | p_2006        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2006-01-01]; ..types: [DATE]; keys: [2007-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13415       | p_2007        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2007-01-01]; ..types: [DATE]; keys: [2008-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13416       | p_2008        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2008-01-01]; ..types: [DATE]; keys: [2009-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13417       | p_2009        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2009-01-01]; ..types: [DATE]; keys: [2010-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13418       | p_2010        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2010-01-01]; ..types: [DATE]; keys: [2011-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13419       | p_2011        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2011-01-01]; ..types: [DATE]; keys: [2012-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13420       | p_2012        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2012-01-01]; ..types: [DATE]; keys: [2013-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13421       | p_2013        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2013-01-01]; ..types: [DATE]; keys: [2014-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13422       | p_2014        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2014-01-01]; ..types: [DATE]; keys: [2015-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13423       | p_2015        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2015-01-01]; ..types: [DATE]; keys: [2016-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13424       | p_2016        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2016-01-01]; ..types: [DATE]; keys: [2017-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13425       | p_2017        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2017-01-01]; ..types: [DATE]; keys: [2018-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13426       | p_2018        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2018-01-01]; ..types: [DATE]; keys: [2019-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13427       | p_2019        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2019-01-01]; ..types: [DATE]; keys: [2020-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13428       | p_2020        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2020-01-01]; ..types: [DATE]; keys: [2021-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13429       | p_202101      | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2021-01-01]; ..types: [DATE]; keys: [2021-02-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13430       | p_202102      | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2021-02-01]; ..types: [DATE]; keys: [2021-03-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13431       | p_202103      | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2021-03-01]; ..types: [DATE]; keys: [2021-04-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13432       | p_202104      | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2021-04-01]; ..types: [DATE]; keys: [2021-05-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13433       | p_202105      | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2021-05-01]; ..types: [DATE]; keys: [2021-06-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13434       | p_202106      | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2021-06-01]; ..types: [DATE]; keys: [2021-07-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13435       | p_202107      | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2021-07-01]; ..types: [DATE]; keys: [2021-08-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13436       | p_202108      | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2021-08-01]; ..types: [DATE]; keys: [2021-09-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13437       | p_202109      | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2021-09-01]; ..types: [DATE]; keys: [2021-10-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13438       | p_202110      | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2021-10-01]; ..types: [DATE]; keys: [2021-11-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13439       | p_202111      | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2021-11-01]; ..types: [DATE]; keys: [2021-12-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13440       | p_202112      | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2021-12-01]; ..types: [DATE]; keys: [2022-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13441       | p_2022_01     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-01-01]; ..types: [DATE]; keys: [2022-01-03]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13442       | p_2022_02     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-01-03]; ..types: [DATE]; keys: [2022-01-10]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13443       | p_2022_03     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-01-10]; ..types: [DATE]; keys: [2022-01-17]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13444       | p_2022_04     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-01-17]; ..types: [DATE]; keys: [2022-01-24]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13445       | p_2022_05     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-01-24]; ..types: [DATE]; keys: [2022-01-31]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13446       | p_2022_06     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-01-31]; ..types: [DATE]; keys: [2022-02-07]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13447       | p_2022_07     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-02-07]; ..types: [DATE]; keys: [2022-02-14]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13448       | p_2022_08     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-02-14]; ..types: [DATE]; keys: [2022-02-21]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13449       | p_2022_09     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-02-21]; ..types: [DATE]; keys: [2022-02-28]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13450       | p_2022_10     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-02-28]; ..types: [DATE]; keys: [2022-03-07]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13451       | p_2022_11     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-03-07]; ..types: [DATE]; keys: [2022-03-14]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13452       | p_2022_12     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-03-14]; ..types: [DATE]; keys: [2022-03-21]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13453       | p_2022_13     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-03-21]; ..types: [DATE]; keys: [2022-03-28]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13454       | p_2022_14     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-03-28]; ..types: [DATE]; keys: [2022-04-04]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13455       | p_2022_15     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-04-04]; ..types: [DATE]; keys: [2022-04-11]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13456       | p_2022_16     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-04-11]; ..types: [DATE]; keys: [2022-04-18]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13457       | p_2022_17     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-04-18]; ..types: [DATE]; keys: [2022-04-25]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13458       | p_2022_18     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-04-25]; ..types: [DATE]; keys: [2022-05-02]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13459       | p_2022_19     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-05-02]; ..types: [DATE]; keys: [2022-05-09]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13460       | p_2022_20     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-05-09]; ..types: [DATE]; keys: [2022-05-16]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13461       | p_2022_21     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-05-16]; ..types: [DATE]; keys: [2022-05-23]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13462       | p_2022_22     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-05-23]; ..types: [DATE]; keys: [2022-05-30]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13463       | p_2022_23     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-05-30]; ..types: [DATE]; keys: [2022-06-06]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13464       | p_2022_24     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-06-06]; ..types: [DATE]; keys: [2022-06-13]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13465       | p_2022_25     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-06-13]; ..types: [DATE]; keys: [2022-06-20]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13466       | p_2022_26     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-06-20]; ..types: [DATE]; keys: [2022-06-27]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13467       | p_2022_27     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-06-27]; ..types: [DATE]; keys: [2022-07-04]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13468       | p_2022_28     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-07-04]; ..types: [DATE]; keys: [2022-07-11]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13469       | p_2022_29     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-07-11]; ..types: [DATE]; keys: [2022-07-18]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13470       | p_2022_30     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-07-18]; ..types: [DATE]; keys: [2022-07-25]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13471       | p_2022_31     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-07-25]; ..types: [DATE]; keys: [2022-08-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13472       | p_2022_32     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-08-01]; ..types: [DATE]; keys: [2022-08-08]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13473       | p_2022_33     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-08-08]; ..types: [DATE]; keys: [2022-08-15]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13474       | p_2022_34     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-08-15]; ..types: [DATE]; keys: [2022-08-22]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13475       | p_2022_35     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-08-22]; ..types: [DATE]; keys: [2022-08-29]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13476       | p_2022_36     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-08-29]; ..types: [DATE]; keys: [2022-09-05]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13477       | p_2022_37     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-09-05]; ..types: [DATE]; keys: [2022-09-12]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13478       | p_2022_38     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-09-12]; ..types: [DATE]; keys: [2022-09-19]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13479       | p_2022_39     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-09-19]; ..types: [DATE]; keys: [2022-09-26]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13480       | p_2022_40     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-09-26]; ..types: [DATE]; keys: [2022-10-03]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13481       | p_2022_41     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-10-03]; ..types: [DATE]; keys: [2022-10-10]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13482       | p_2022_42     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-10-10]; ..types: [DATE]; keys: [2022-10-17]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13483       | p_2022_43     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-10-17]; ..types: [DATE]; keys: [2022-10-24]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13484       | p_2022_44     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-10-24]; ..types: [DATE]; keys: [2022-10-31]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13485       | p_2022_45     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-10-31]; ..types: [DATE]; keys: [2022-11-07]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13486       | p_2022_46     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-11-07]; ..types: [DATE]; keys: [2022-11-14]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13487       | p_2022_47     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-11-14]; ..types: [DATE]; keys: [2022-11-21]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13488       | p_2022_48     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-11-21]; ..types: [DATE]; keys: [2022-11-28]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13489       | p_2022_49     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-11-28]; ..types: [DATE]; keys: [2022-12-05]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13490       | p_2022_50     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-12-05]; ..types: [DATE]; keys: [2022-12-12]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13491       | p_2022_51     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-12-12]; ..types: [DATE]; keys: [2022-12-19]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13492       | p_2022_52     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-12-19]; ..types: [DATE]; keys: [2022-12-26]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13493       | p_2022_53     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-12-26]; ..types: [DATE]; keys: [2023-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13494       | p_20230101    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-01]; ..types: [DATE]; keys: [2023-01-02]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13495       | p_20230102    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-02]; ..types: [DATE]; keys: [2023-01-03]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13496       | p_20230103    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-03]; ..types: [DATE]; keys: [2023-01-04]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13497       | p_20230104    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-04]; ..types: [DATE]; keys: [2023-01-05]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13498       | p_20230105    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-05]; ..types: [DATE]; keys: [2023-01-06]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13499       | p_20230106    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-06]; ..types: [DATE]; keys: [2023-01-07]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13500       | p_20230107    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-07]; ..types: [DATE]; keys: [2023-01-08]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13501       | p_20230108    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-08]; ..types: [DATE]; keys: [2023-01-09]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13502       | p_20230109    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-09]; ..types: [DATE]; keys: [2023-01-10]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13503       | p_20230110    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-10]; ..types: [DATE]; keys: [2023-01-11]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13504       | p_20230111    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-11]; ..types: [DATE]; keys: [2023-01-12]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13505       | p_20230112    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-12]; ..types: [DATE]; keys: [2023-01-13]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13506       | p_20230113    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-13]; ..types: [DATE]; keys: [2023-01-14]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13507       | p_20230114    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-14]; ..types: [DATE]; keys: [2023-01-15]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13508       | p_20230115    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-15]; ..types: [DATE]; keys: [2023-01-16]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13509       | p_20230116    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-16]; ..types: [DATE]; keys: [2023-01-17]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13510       | p_20230117    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-17]; ..types: [DATE]; keys: [2023-01-18]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13511       | p_20230118    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-18]; ..types: [DATE]; keys: [2023-01-19]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13512       | p_20230119    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-19]; ..types: [DATE]; keys: [2023-01-20]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13513       | p_20230120    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-20]; ..types: [DATE]; keys: [2023-01-21]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13514       | p_20230121    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-21]; ..types: [DATE]; keys: [2023-01-22]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13515       | p_20230122    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-22]; ..types: [DATE]; keys: [2023-01-23]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13516       | p_20230123    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-23]; ..types: [DATE]; keys: [2023-01-24]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13517       | p_20230124    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-24]; ..types: [DATE]; keys: [2023-01-25]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13518       | p_20230125    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-25]; ..types: [DATE]; keys: [2023-01-26]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13519       | p_20230126    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-26]; ..types: [DATE]; keys: [2023-01-27]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13520       | p_20230127    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-27]; ..types: [DATE]; keys: [2023-01-28]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13521       | p_20230128    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-28]; ..types: [DATE]; keys: [2023-01-29]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13522       | p_20230129    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-29]; ..types: [DATE]; keys: [2023-01-30]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13523       | p_20230130    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-30]; ..types: [DATE]; keys: [2023-01-31]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13524       | p_20230131    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-31]; ..types: [DATE]; keys: [2023-02-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
117 rows in set (0.02 sec)

 List 分区

  • 分区列支持 BOOLEAN, TINYINT, SMALLINT, INT, BIGINT, LARGEINT, DATE, DATETIME, CHAR, VARCHAR 数据类型,分区值为枚举值。只有当数据为目标分区枚举值其中之一时,才可以命中分区。

  • Partition 支持通过 VALUES IN (...) 来指定每个分区包含的枚举值。

  • 下面通过示例说明,进行分区的增删操作时,分区的变化。

测试建表

CREATE TABLE IF NOT EXISTS example_range_tbl
(`user_id` LARGEINT NOT NULL COMMENT "用户id",`date` DATE NOT NULL COMMENT "数据灌入日期时间",`city` VARCHAR(20) not NULL COMMENT "用户所在城市",`age` SMALLINT COMMENT "用户年龄",`sex` TINYINT COMMENT "用户性别",`last_visit_date` DATETIME REPLACE DEFAULT "1970-01-01 00:00:00" COMMENT "用户最后一次访问时间",`cost` BIGINT SUM DEFAULT "0" COMMENT "用户总消费",`max_dwell_time` INT MAX DEFAULT "0" COMMENT "用户最大停留时间",`min_dwell_time` INT MIN DEFAULT "99999" COMMENT "用户最小停留时间"
)
ENGINE=OLAP
AGGREGATE KEY(`user_id`, `date`, `city`, `age`, `sex`)
PARTITION BY LIST(city)
(PARTITION `p_huabei` VALUES IN ("beijing", "tianjin", "shijiazhuang"),PARTITION `p_dongbei` VALUES IN ("shenyang", "dalian"),PARTITION `p_huazhong` VALUES IN ("wuhan", "changsha"),PARTITION `p_xinan` VALUES IN ("chengdu", "chongqing")
)
DISTRIBUTED BY HASH(`user_id`) BUCKETS 5
PROPERTIES
("replication_num" = "1"
);

LIST(city) 里面的city字段不能为空

测试数据

insert into example_range_tbl values(10001,'2017-01-05','beijing',30,1,'2017-10-01 17:05:45',2,22,22); 
insert into example_range_tbl values(10000,'2017-02-01','tianjin',20,0,'2017-10-01 06:00:00',20,10,10);
insert into example_range_tbl values(10000,'2017-03-03','shenyang',20,0,'2017-10-01 07:00:00',15,2,2);

效果

当我们有了合适的分区分桶时,导入数据导到 Doris 后,数据会依照建表语句中的分区分桶列进行存储。上述网站站点数据的存储示例如图示:

图2:Doris 分区分桶后的数据存储

此时如果执行 SQL 查询:

select * from test_tbl where date = "2020-03-23"  and site = 1

根据谓词 date = "2020-03-23" 可以定位到分区 p20200323,谓词 site = 1 能定位到该分区下的 bucket_1。假设有 30 天数据,自动分桶推算得到的分桶个数为 20 个。则经过明确的分区分桶谓词下推,则可以将数据全表扫描量变为原来的 1/600(30 天*20 个桶 = 600),极大减少了数据的扫描范围、提高了查询的效率。

实验

动态分区

创建一个动态分区(现在是3月2日)

CREATE TABLE IF NOT EXISTS example_range_tbl
(`user_id` LARGEINT NOT NULL COMMENT "用户id",`date` DATE NOT NULL COMMENT "数据灌入日期时间",`city` VARCHAR(20) COMMENT "用户所在城市",`age` SMALLINT COMMENT "用户年龄",`sex` TINYINT COMMENT "用户性别",`last_visit_date` DATETIME REPLACE DEFAULT "1970-01-01 00:00:00" COMMENT "用户最后一次访问时间",`cost` BIGINT SUM DEFAULT "0" COMMENT "用户总消费",`max_dwell_time` INT MAX DEFAULT "0" COMMENT "用户最大停留时间",`min_dwell_time` INT MIN DEFAULT "99999" COMMENT "用户最小停留时间"
)
ENGINE=OLAP
AGGREGATE KEY(`user_id`, `date`, `city`, `age`, `sex`)
PARTITION BY RANGE(`date`)()
DISTRIBUTED BY HASH(`user_id`)
PROPERTIES ("replication_allocation" = "tag.location.default: 1", "dynamic_partition.enable" = "true","dynamic_partition.time_unit" = "DAY","dynamic_partition.prefix" = "p",  "dynamic_partition.buckets" = "3","dynamic_partition.create_history_partition" = "true","dynamic_partition.end" = "2","dynamic_partition.start" = "-3"
);

查看现在的分区(可以看到创建了历史3天和未来2天的数据)

mysql> show partitions from example_range_tbl;
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
| PartitionId | PartitionName | VisibleVersion | VisibleVersionTime  | State  | PartitionKey | Range                                                                      | DistributionKey | Buckets | ReplicationNum | StorageMedium | CooldownTime        | RemoteStoragePolicy | LastConsistencyCheckTime | DataSize | IsInMemory | ReplicaAllocation       |
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
| 15869       | p20230227     | 1              | 2023-03-02 17:44:48 | NORMAL | date         | [types: [DATE]; keys: [2023-02-27]; ..types: [DATE]; keys: [2023-02-28]; ) | user_id         | 3       | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 15876       | p20230228     | 1              | 2023-03-02 17:44:48 | NORMAL | date         | [types: [DATE]; keys: [2023-02-28]; ..types: [DATE]; keys: [2023-03-01]; ) | user_id         | 3       | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 15883       | p20230301     | 1              | 2023-03-02 17:44:48 | NORMAL | date         | [types: [DATE]; keys: [2023-03-01]; ..types: [DATE]; keys: [2023-03-02]; ) | user_id         | 3       | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 15890       | p20230302     | 1              | 2023-03-02 17:44:48 | NORMAL | date         | [types: [DATE]; keys: [2023-03-02]; ..types: [DATE]; keys: [2023-03-03]; ) | user_id         | 3       | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 15897       | p20230303     | 1              | 2023-03-02 17:44:48 | NORMAL | date         | [types: [DATE]; keys: [2023-03-03]; ..types: [DATE]; keys: [2023-03-04]; ) | user_id         | 3       | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 15904       | p20230304     | 1              | 2023-03-02 17:44:48 | NORMAL | date         | [types: [DATE]; keys: [2023-03-04]; ..types: [DATE]; keys: [2023-03-05]; ) | user_id         | 3       | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
6 rows in set (0.00 sec)

查看第二天的情况 (现在是3月3日)

手动分区实验

建表语句

CREATE TABLE IF NOT EXISTS example_range_tbltest
(`user_id` LARGEINT NOT NULL COMMENT "用户id",`date` DATE NOT NULL COMMENT "数据灌入日期时间",`city` VARCHAR(20) COMMENT "用户所在城市",`age` SMALLINT COMMENT "用户年龄",`sex` TINYINT COMMENT "用户性别",`last_visit_date` DATETIME REPLACE DEFAULT "1970-01-01 00:00:00" COMMENT "用户最后一次访问时间",`cost` BIGINT SUM DEFAULT "0" COMMENT "用户总消费",`max_dwell_time` INT MAX DEFAULT "0" COMMENT "用户最大停留时间",`min_dwell_time` INT MIN DEFAULT "99999" COMMENT "用户最小停留时间"
)
ENGINE=OLAP
AGGREGATE KEY(`user_id`, `date`, `city`, `age`, `sex`)
PARTITION BY RANGE(`date`)
(PARTITION `p201701` VALUES LESS THAN ("2017-02-01"),PARTITION `p201702` VALUES LESS THAN ("2017-03-01"),PARTITION `p201703` VALUES LESS THAN ("2017-04-01")
)
DISTRIBUTED BY HASH(`user_id`) BUCKETS 5
PROPERTIES
("replication_num" = "1"
);

查看分区

mysql> show partitions from example_range_tbltest;
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
| PartitionId | PartitionName | VisibleVersion | VisibleVersionTime  | State  | PartitionKey | Range                                                                      | DistributionKey | Buckets | ReplicationNum | StorageMedium | CooldownTime        | RemoteStoragePolicy | LastConsistencyCheckTime | DataSize | IsInMemory | ReplicaAllocation       |
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
| 15911       | p201701       | 1              | 2023-03-02 17:52:52 | NORMAL | date         | [types: [DATE]; keys: [0000-01-01]; ..types: [DATE]; keys: [2017-02-01]; ) | user_id         | 5       | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 15912       | p201702       | 1              | 2023-03-02 17:52:52 | NORMAL | date         | [types: [DATE]; keys: [2017-02-01]; ..types: [DATE]; keys: [2017-03-01]; ) | user_id         | 5       | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 15913       | p201703       | 1              | 2023-03-02 17:52:52 | NORMAL | date         | [types: [DATE]; keys: [2017-03-01]; ..types: [DATE]; keys: [2017-04-01]; ) | user_id         | 5       | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
3 rows in set (0.01 sec)

插入数据

insert into example_range_tbltest values(10000,'2017-04-02','shenyang',20,0,'2017-10-01 07:00:00',15,2,2);

下面报错因为没有对应的分区 

mysql> insert into example_range_tbltest values(10000,'2017-04-02','shenyang',20,0,'2017-10-01 07:00:00',15,2,2);
ERROR 5025 (HY000): Insert has filtered data in strict mode, tracking_url=http://10.240.0.51:8040/api/_load_error_log?file=__shard_235/error_log_insert_stmt_749a91311755470e-8b2b8b059bce5df2_749a91311755470e_8b2b8b059bce5df2

手动添加一个分区

ALTER TABLE example_range_tbltest ADD PARTITION p201704 VALUES LESS THAN ("2017-05-01");
mysql> show partitions from example_range_tbltest;
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
| PartitionId | PartitionName | VisibleVersion | VisibleVersionTime  | State  | PartitionKey | Range                                                                      | DistributionKey | Buckets | ReplicationNum | StorageMedium | CooldownTime        | RemoteStoragePolicy | LastConsistencyCheckTime | DataSize | IsInMemory | ReplicaAllocation       |
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
| 15911       | p201701       | 1              | 2023-03-02 17:52:52 | NORMAL | date         | [types: [DATE]; keys: [0000-01-01]; ..types: [DATE]; keys: [2017-02-01]; ) | user_id         | 5       | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 15912       | p201702       | 1              | 2023-03-02 17:52:52 | NORMAL | date         | [types: [DATE]; keys: [2017-02-01]; ..types: [DATE]; keys: [2017-03-01]; ) | user_id         | 5       | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 15913       | p201703       | 1              | 2023-03-02 17:52:52 | NORMAL | date         | [types: [DATE]; keys: [2017-03-01]; ..types: [DATE]; keys: [2017-04-01]; ) | user_id         | 5       | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 15946       | p201704       | 1              | 2023-03-02 17:57:34 | NORMAL | date         | [types: [DATE]; keys: [2017-04-01]; ..types: [DATE]; keys: [2017-05-01]; ) | user_id         | 5       | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
4 rows in set (0.00 sec)

 然后插入数据(可以看到新的分区插入数据成功)

mysql> insert into example_range_tbltest values(10000,'2017-04-02','shenyang',20,0,'2017-10-01 07:00:00',15,2,2);
Query OK, 1 row affected (0.03 sec)
{'label':'insert_9ef4039c342c494c_aa49e0c045fbcf55', 'status':'VISIBLE', 'txnId':'1030'}

 参考资料

一文教你玩转 Apache Doris 分区分桶新功能

相关文章:

Doris入门篇-分区分桶实验

简介 测试分区分桶效果。 分区的基本操作 添加分区 ALTER TABLE v2x_olap_database.government_car ADD PARTITION p20221203 VALUES LESS THAN ("2022-12-04");动态分区表不能添加分区&#xff0c;需要转为手动分区表。 查看分区 show partitions from <表…...

Spring-Xml配置

一、Spring 简介 1.简介 文档下载地址&#xff1a;Index of /spring-framework/docs 1.简介 Spring framework 是 Spring 基础框架 学习Spring 家族产品 Spring framework SpringBoot SpringCloud Spring 能用来做什么 开发 WEB 项目 微服务 分布式系统 Spring framew…...

设计模式-工作线程 创建多少线程池合适

1、定义 让有限的工作线程(Worker Thread)来轮流异步处理无限多的任务。也可以将其归类为分工模式&#xff0c;它的典型实现就是线程池&#xff0c;也体现了经典设计模式中的享元模式&#xff08;重用对象&#xff09;。 例如&#xff0c;海底捞的服务员(线程)&#xff0c;轮流…...

【算法基础】深度优先搜索(DFS) 广度优先搜索(BFS)

一、DFS & BFS 1. 深度优先搜索DFS 深度优先搜索属于图算法的一种,英文缩写为DFS即Depth First Search.其过程简要来说是对每一个可能的分支路径深入到不能再深入为止,而且每个节点只能访问一次。 2. 广度优先搜索BFS 广度优先搜索较之深度优先搜索之不同在于,深度…...

【分布式】ProtocolBuffer平滑升级原则

原文链接&#xff1a;https://blog.csdn.net/nash_cyk/article/details/99549719 关于Protocol Buffer优势这里就不详细介绍了&#xff0c;如便于不同开发语言的交互通信&#xff0c;便于服务器上线的平滑升级等。 但Protocol Buffer的Message协议升级是需要注意一些细节&…...

第四阶段17-关于Redis中的list类型,缓存预热,关于Mybatis中的`#{}`和`${}`这2种格式的占位符

关于Redis中的list类型 Redis中的list是一种先进后出、后进先出的栈结构的数据。 在使用Redis时&#xff0c;应该将list想像为以上图例中翻转了90度的样子&#xff0c;例如&#xff1a; 在Redis中的list数据&#xff0c;不仅可以从左侧压入&#xff0c;也可以选择从右侧压入…...

stringstream用法

stringstream是 C++ 提供的另一个字串型的串流(stream)物件,和之前学过的iostream、fstream有类似的操作方式。包含在头文件sstream中(#include <sstream>)。 实例: 1、C++标准库中的<sstream>提供了比ANSI C的<stdio.h>更高级的一些功能,即单纯性、类…...

2022年下半年系统集成项目管理工程师综合知识真题及答案解析

2022年下半年系统集成项目管理工程师综合知识真题及答案解析 1、()不属于“提升云计算自主创新能力”的工作内容。A.加强云计算相关基础研究、应用研究、技术研发、市场培育和产业政策密衔接与统筹协调B.引导大型云计算中心优先在能源充足、气候适宜、自然灾害较少的地区部…...

【洛谷 P2089】烤鸡(搜索)

烤鸡 题目背景 猪猪 Hanke 得到了一只鸡。 题目描述 猪猪 Hanke 特别喜欢吃烤鸡&#xff08;本是同畜牲&#xff0c;相煎何太急&#xff01;&#xff09;Hanke 吃鸡很特别&#xff0c;为什么特别呢&#xff1f;因为他有 101010 种配料&#xff08;芥末、孜然等&#xff09;…...

Mac item2 配置免密登录开发机

1、配置 vi ~/.ssh/config 内容如下&#xff1a; Host * ControlMaster auto ControlPath ~/.ssh/master-%r%h:%p ControlPersist yes ServerAliveInterval 60 学习&#xff1a; ControlMaster #连接共享 ControlPath #与ControlMaster一起使用&#xff0c;指定连接共享的路径…...

vue 解决问题:Webpack安装不成功,webpack -v无法正常显示版本号

目录 一、解决问题&#xff1a;Webpack安装不成功&#xff0c;webpack -v无法正常显示版本号 二、解决问题&#xff1a; ERROR Error: Cannot find module webpack-log 三、 解决报错&#xff1a;error:03000086:digital envelope routines::initialization error 四、解决…...

07-1【openEuler】系统及进程管理(网络管理的补充实验及说明)

文章目录说在前面关于nmcli命令的使用使用nmcli命令修改主机IP地址1、运行ip addr列出openEuler20.03上的以太网卡2、列出当前活动的以太网卡3、开始分配静态IP地址&#xff08;1&#xff09;命令语法&#xff08;2&#xff09;将 IPv4 地址192.168.74.175分配给 ens33 网卡上&…...

【Linux】磁盘结构、文件系统、软硬链接、动静态库链接

文章目录1、磁盘结构1.1 磁盘的物理结构1.2 磁盘的存储结构1.3 磁盘的逻辑结构2、文件系统2.1 4KB加载到内存2.2 文件系统结构3、软硬链接3.1 软链接3.2 硬链接4、动静态库4.1 什么是库&#xff1f;4.2 静态库和静态库链接4.3 动态库和动态库链接4.4 动静态库的加载下面了解到&…...

交换机电口、光口、网络速率的基本概念总结

电口和光口千兆网 & 万兆网&#xff1a;POE&#xff1a;包转发率&#xff1a;背板带宽/交换容量&#xff1a;)电口和光口 电口&#xff1a; 电口也即RJ45口&#xff0c;插双绞线的端口&#xff08;网线&#xff09;&#xff0c;一般速率为10M或100M&#xff0c;即为百兆工…...

【面试题 05.02. 二进制数转字符串】

来源&#xff1a;力扣&#xff08;LeetCode&#xff09; 描述&#xff1a; 二进制数转字符串。给定一个介于0和1之间的实数&#xff08;如0.72&#xff09;&#xff0c;类型为double&#xff0c;打印它的二进制表达式。如果该数字无法精确地用32位以内的二进制表示&#xff0…...

webpack - webpack的基本使用和总结

文章目录1&#xff0c;webpack概念2&#xff0c;为什么学webpack3&#xff0c;webpack特点4&#xff0c;相对于其他工具优点5&#xff0c;准备工作6&#xff0c;webpack的核心介绍7&#xff0c;webpack使用 - 打包js代码8&#xff0c;打包css代码9&#xff0c;生成html文件10&a…...

【蓝桥杯嵌入式】定时器实现按键单击,双击,消抖以及长按的代码实现

&#x1f38a;【蓝桥杯嵌入式】专题正在持续更新中&#xff0c;原理图解析✨&#xff0c;各模块分析✨以及历年真题讲解✨都在这儿哦&#xff0c;欢迎大家前往订阅本专题&#xff0c;获取更多详细信息哦&#x1f38f;&#x1f38f;&#x1f38f; &#x1fa94;本系列专栏 - 蓝…...

基于SSM的Javaweb爱心扶贫捐赠系统

文章目录 项目介绍主要功能截图:后台登录首页个人中心用户管理扶贫物资管理扶贫产品管理留言板管理前台前台首页扶贫产品新闻资讯留言板部分代码展示设计总结项目获取方式🍅 作者主页:Java韩立 🍅 简介:Java领域优质创作者🏆、 简历模板、学习资料、面试题库【关注我,…...

Spring Cloud(微服务)学习篇(三)

Spring Cloud(微服务)学习篇(三) 1 nacos中使用openFeign(调用方式)实现短信发送 1.1 在shop-sms-api中创建com.zlz.shop.sms.api.service/vo/dto/util,目录结构如下所示 1.2 在pom.xml(shop-sms-api)中加入如下依赖 <dependencies><dependency><groupId>…...

一文带你吃透JSP,增删改查实战案例详细解读

文章目录前言JSP 概述JSP快速入门搭建环境导入JSP依赖创建 JSP 页面编写代码测试JSP原理JSP 脚本实战案例JSP缺点发展阶段EL 表达式概述实战案例域对象JSTL 标签用法1用法2前言 不得不说&#xff0c;JSP 现在已经是一门十分老旧的技术了&#xff0c;学习编程时&#xff0c;不仅…...

taobao.item.propimg.upload( 添加或修改属性图片 )

&#xffe5;开放平台基础API必须用户授权 添加一张商品属性图片到num_iid指定的商品中 传入的num_iid所对应的商品必须属于当前会话的用户 图片的属性必须要是颜色的属性&#xff0c;这个在前台显示的时候需要和sku进行关联的 商品属性图片只有享有服务的卖家&#xff08;如&a…...

TDEngine集群监控组件安装配置(Telegra+Grafana方案)

Tdengine的监控指标包括以下几个方面&#xff1a; 系统指标&#xff1a;CPU使用率、内存使用率、磁盘空间、网络流量等。数据库指标&#xff1a;连接数、查询数、写入数、读取数等。SQL指标&#xff1a;执行时间、执行计划、索引使用情况等。集群指标&#xff1a;节点状态、数…...

【定位】高德地图wifi定位接口使用效果实践

高德地图wifi定位接口使用效果实践 背景 目的是基于高德地图wifi定位接口实现在高德地图上展示终端设备的位置和轨迹。 原理 为了将原理阐述的稍微直白一点,特意使用UML图表产生下面的一个序列图: #mermaid-svg-iHgWizHiUSRqCWdF {font-family:"trebuchet ms",…...

Nacos注册中心

目录 认识和安装Nacos 启动方式 Nacos快速入门 提示 Nacos服务分级存储模型 服务跨集群调用问题 管理端设置策略 总结 Nacos环境隔离 如何创建 使用方式 ​编辑 总结 Nacos注册中心分析 临时实例和非临时实例 定义 配置方式 总结 认识和安装Nacos Nacos是Sp…...

Liunx常用命令总结

常用命令arch 显示机器的处理器架构(1) uname -m 显示机器的处理器架构(2) uname -r 显示正在使用的内核版本 dmidecode -q 显示硬件系统部件 - (SMBIOS / DMI) hdparm -i /dev/hda 罗列一个磁盘的架构特性 hdparm -tT /dev/sda 在磁盘上执行测试性读取操作 cat /proc/cpuinfo …...

MySQL表的增删查改(进阶)

所有操作&#xff1a;主要讲了数据库的约束&#xff0c;表之间的关系&#xff0c;新增&#xff0c;聚合查询&#xff0c;联合查询等内容。是一篇博客所有操作的记录。 844d186 风夏/mysql_learning - Gitee.com数据库约束1.1 约束条件not null -指定某个列不能储存null值。un…...

【RocksDB】Ubuntu20.04下编译rocksdb

前言&#xff1a; 我在刚学rocksdb的时候是在2022年&#xff0c;但是网上的资源很少&#xff0c;查了好久才把rocksdb安装成功&#xff0c;在这里向大家分享一下我的经历&#xff0c;安装过程中也报了很多错误&#xff0c;希望大家不要迷路 首先 在虚拟机里面安装依赖的包以…...

这可能是Spring Boot Starter 讲的最清楚的一次了

Spring Boot Starter 是 Spring Boot 中非常重要的一个功能&#xff0c;它可以帮助开发人员快速集成各种第三方库和框架。本文将从 Spring Boot Starter 的基本概念入手&#xff0c;深入讲解 Spring Boot Starter 的实现原理及其应用场景。 一、Spring Boot Starter 的概念 S…...

activiti7执行流程详解

什么是工作流&#xff1f; 官方定义&#xff1a;工作流是将一组任务组织起来以完成某个经营过程&#xff1a;定义了任务的触发顺序和触发条件&#xff0c;每个任务可以由一个或多个软件系统完成&#xff0c;也可以由一个或一组人完成&#xff0c;还可以由一个或多个人与软件系统…...

iframe页面传值取值

业务&#xff1a;目标界面的是用原生js写的 &#xff0c; 被镶嵌到vue平台上 &#xff0c; 现在要求vue点击跳转的时候 &#xff0c;要附带上值 &#xff0c;让原生界面获取到值 &#xff0c; 完成页面设置查询。 想法 &#xff1a; vue跳转&#xff0c;使用this.$route.qu…...

gov域名网站有哪些/个人网站网页首页

正则表达式短横线&#xff02;-&#xff02;的转义写法示例 2015-11-11 10:54 301人阅读 评论(0) 收藏 举报分类&#xff1a;linux/unix&#xff08;688&#xff09; 正则表达式&#xff08;1&#xff09; 一直以为正则方括号内的短横线是要转义的&#xff0c;例&#xff1a; …...

廊坊森德科技有限公司/长沙百度快速优化

标签 PostgreSQL , cube , rum , pg_trgm , smlar , imgsmlr , pg_similarity , gin , gist , 倒排 , 相似 , 向量 , 特征 , 图像 , 文本 , 字符串 , 全文检索 背景 在搜索业务场景中&#xff0c;相似搜索是一个非常常见的需求。 PostgreSQL有很多插件、索引可以支持海量数据的…...

电子商务网站的建设方法/深圳网络推广平台

Vue.js 2 vs Vue.js 3的实现 – 云栖社区 vue.js核心团队已经讨论过将在Vue3实现的变化。虽然API不会改变&#xff0c;但是数据响应机制&#xff08;译者注&#xff1a;对数据改变的监听和通知&#xff09;发生了变化。这意味着什么呢&#xff0c;同时它对你意味着什么呢&#…...

东西湖建设局网站/李勇seo博客

Cascade Region Proposal and Global Context for Deep Object Detection - 2017年10月 - 改进了faster-RCNN - 杭州海康威视研究院网络结构就是Faster R-CNN级联RPN&#xff08;即两个RPN和两个ROIpooling&#xff09;。   另外&#xff0c;还有些训练技巧,细节见论…...

网站首页倒计时功能怎么做/哈尔滨seo网络推广

新的语义标签解释文档https://www.ibm.com/developerworks/cn/web/wa-html5fundamentals/ 标签 描述 4 5 <!--...--> 定义注释。 4 5 <!DOCTYPE> 定义文档类型。 4 5 <a> 定义超链接。 4 5 <abbr> 定义缩写。 4 5 <acronym> HTML 5 中不…...

素材网站开发/电脑系统优化软件排行榜

1.LK&LT(设备接入&管理) 固件升级全新改版固件升级全新改版&#xff0c;固件和产品关联&#xff0c;并支持固件版本统计。 之前固件升级无法查看固件版本分布&#xff0c;数据不透明&#xff0c;会给用户造成困扰&#xff0c;本次进行了全新改版&#xff01;固件都已根…...