gpt4 book ai didi

google-bigquery - Bigquery 分片与 Bigquery 分区

转载 作者:行者123 更新时间:2023-12-01 13:41:47 36 4
gpt4 key购买 nike

我有一个包含 340GB 数据的表,但我们只使用了最后一周的数据。因此,为了最小化将这些数据移动到分区表或分片表的成本计划。

我对分片表和分区做了一些实验。我创建了分区表并加载了两天的数据(两个分区)并创建了两个分片表(单个表)。我试图提取最近两天的数据。

全 table - 27 秒
分区表 - 33 秒
分片表 - 91 秒

请让我知道哪种方式最好。根据实验结果,当我针对全表运行时会给出快速但全表会扫描的结果。

谢谢,

最佳答案

来自 Partitioning versus Sharding 上的 GCP 官方文档你应该使用分区表。

Partitioned tables perform better than tables sharded by date. When you create date-named tables, BigQuery must maintain a copy of the schema and metadata for each date-named table. Also, when date-named tables are used, BigQuery might be required to verify permissions for each queried table. This practice also adds to query overhead and impacts query performance. The recommended best practice is to use partitioned tables instead of date-sharded tables.

关于google-bigquery - Bigquery 分片与 Bigquery 分区,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39514899/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com