QuestDB:每周分区

发布于 2025-02-13 02:28:12 字数 252 浏览 1 评论 0原文

有没有办法在QUESTDB中按一周来分区表? QUESTDB documentation 显示none年代码>,<代码>月小时

Is there a way to partition tables by week in QuestDB? The QuestDB documentation shows NONE, YEAR, MONTH, DAY, and HOUR.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清风疏影 2025-02-20 02:28:12

由于版本 6.7 ,因此支持按每周进行分区。

例子:

create table tab ( ts timestamp ) timestamp(ts) partition by WEEK;
insert into tab values ( '2023-01-01T00:00:00.000000Z' );
insert into tab values ( '2023-01-08T00:00:00.000000Z' );

selecT name, minTimestamp, maxTimestamp from table_partitions('tab');

name    minTimestamp    maxTimestamp
2022-W52    2023-01-01T00:00:00.000000Z 2023-01-01T00:00:00.000000Z
2023-W01    2023-01-08T00:00:00.000000Z 2023-01-08T00:00:00.000000Z

Partitioning by WEEK is supported since version 6.7 .

Example:

create table tab ( ts timestamp ) timestamp(ts) partition by WEEK;
insert into tab values ( '2023-01-01T00:00:00.000000Z' );
insert into tab values ( '2023-01-08T00:00:00.000000Z' );

selecT name, minTimestamp, maxTimestamp from table_partitions('tab');

name    minTimestamp    maxTimestamp
2022-W52    2023-01-01T00:00:00.000000Z 2023-01-01T00:00:00.000000Z
2023-W01    2023-01-08T00:00:00.000000Z 2023-01-08T00:00:00.000000Z
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文