利用成本洞察来节省开支
Snowflake 提供成本洞察,可识别在特定账户内优化 Snowflake 成本的机会。这些洞察每周都会进行计算和更新。
每个洞察都表明通过优化 Snowflake 可以节省多少 Credit 或兆字节。
To access the Cost Insights tile:
- Sign in to Snowsight.
- Switch to a role with access to cost-related features.
- In the navigation menu, select Admin » Cost management.
- Select the Account Overview tab.
- Find the Cost insights tile.
以下每个洞察都包括关于如何优化支出的建议。
- Insight: Rarely used tables with automatic clustering
- Insight: Rarely used materialized views
- Insight: Rarely used search optimization paths
- Insight: Large tables that are never queried
- Insight: Tables over 100 GB from which data is written but not read
- Insight: Short-lived permanent tables
- Insight: Inefficient usage of multi-cluster warehouses
- Insight: Rarely used tables with automatic clustering
This insight identifies tables with automatic clustering that are queried fewer than 100 times per week by this account.
为表启用自动聚类可以显著提高针对该表的查询性能。不过,随着表的变化,Snowflake 必须使用无服务器计算资源来使其保持良好的聚类状态。如果对表执行的查询次数很少,所产生的成本可能不足以证明性能提升的合理性。
建议: 考虑禁用这些表的自动聚类。在关闭自动聚类之前,请确定表是仅为灾难恢复目的而存在,还是通过数据共享供其他 Snowflake 账户使用,这可能解释了该表不经常被访问的原因。
For example, to disable automatic clustering for a table named
t1, execute the following command:
- Insight: Rarely used materialized views
This insight identifies materialized views that are queried fewer than 10 times per week by this account.
创建物化视图可以显著提高某些查询模式的性能。不过,物化视图会产生额外的存储成本,以及与保持物化视图与新数据同步相关的无服务器计算成本。如果对物化视图执行的查询次数很少,所产生的成本可能不足以证明性能提升的合理性。
建议: 考虑移除或暂停更新物化视图。在删除物化视图之前,请确定表是仅为灾难恢复目的而存在,还是通过数据共享供其他 Snowflake 账户使用,这可能解释了该表不经常被访问的原因。
For example, to delete a materialized view named
mv1, execute the following command:
- Insight: Rarely used search optimization paths
This insight identifies search optimization access paths that are used fewer than 10 times per week by this account.
搜索优化使用搜索访问路径来提高某些类型的点查找和分析查询的性能。为表添加搜索优化可以显著提高这些查询的性能。然而,搜索优化会产生额外的存储成本,以及与保持存储更新相关的无服务器计算成本。如果使用由搜索优化创建的搜索访问路径进行查询的次数很少,所产生的成本可能不足以证明性能提升的合理性。
建议: 考虑从表中移除搜索优化。在移除搜索优化之前,请确定表是仅为灾难恢复目的而存在,还是通过数据共享供其他 Snowflake 账户使用,这可能解释了该表不经常被访问的原因。
For example, to completely remove search optimization from a table named
t1, execute the following command:
- Insight: Large tables that are never queried
该洞察可识别此账户在过去一周内未查询过的大型表。
建议: 考虑删除未使用的表,这样可以降低存储成本,而不会影响任何工作负载。在删除这些表之前,请确定表是仅为灾难恢复目的而存在,还是通过数据共享供其他 Snowflake 账户使用,这可能解释了该表不经常被访问的原因。
For example, to delete a table named
t1, execute the following command:
- Insight: Tables over 100 GB from which data is written but not read
该洞察可识别此账户在过去一周内未查询过的大型表。
建议: 如果数据从未读取,则存储数据并将新数据引入 Snowflake,这样可能就有点浪费了。考虑删除这些表以节省存储成本,或者停止写入新数据以节省引入所使用的 Credit。在删除这些表之前,请确定表是仅为灾难恢复目的而存在,还是通过数据共享供其他 Snowflake 账户使用,这可能解释了该表不被读取的原因。
For example, to drop a table named
t1, execute the following command:
- Insight: Short-lived permanent tables
该洞察可识别在创建后 24 小时内删除且大小超过 100 GB 的表。
Recommendation: If data needs to be persisted for only a short time, consider using a temporary table or transient table for future tables. Using a temporary table or transient table might help you save on Fail-safe and Time Travel costs.
For example, to create a new transient table
t1, execute the following command: