Snowflake 如何进行瞬时调整大小?

How does Snowflake do instantaneous resizes?

我当时使用的是 Snowflake,我很惊讶它能够即时调整大小。这是一个非常 10s video 如何立即调整大小的方法,下一次查询仍然是 'warm' 运行 (注意我在查询中有一个 CURRENT_TIMESTAMP所以它永远不会从缓存中 returns):

Snowflake 如何做到瞬时调整大小(与 Redshift 之类的东西完全不同)?这是否意味着它只有一组始终在线的服务器,而调整大小只是 memory/cpu 到 运行 该任务的虚拟分配?底层数据是存储在共享磁盘上还是内存中?

简而言之回答您关于调整大小的问题:是的,您完全正确。

据我所知,Snowflake 在后台管理一个 运行ning 服务器池。所有客户都可以从这里分配一些东西。 结果:从 S 到 XS 的调整大小是从该池中重新分配服务器。

很可能 Virtual Private Snowflake-Edition 的行为不同,因为这些帐户不与其他帐户(VPS 之外)共享资源(例如虚拟仓库)。更多信息:https://docs.snowflake.com/en/user-guide/intro-editions.html#virtual-private-snowflake-vps

关于您的 storage-question: Snowflake 的存储层基本上是一种存储服务,例如亚马逊 S3。在这里,Snowflake 以柱状格式保存数据,以便在 micro-partitions 中更加精确。有关 micro-partitions 的更多信息可在此处找到:https://docs.snowflake.com/en/user-guide/tables-clustering-micropartitions.html

您的虚拟仓库访问此存储层(远程磁盘)或 - 如果查询之前是 运行 - 缓存。有一个本地磁盘缓存(这是你使用SSD-storage的虚拟仓库)和一个结果缓存(可跨虚拟仓库查询最近24小时内):https://community.snowflake.com/s/article/Caching-in-Snowflake-Data-Warehouse

为了扩展现有答案,ALTER WAREHOUSE 在标准设置中是非阻塞语句,这意味着它 returns 在提交后立即控制。

ALTER WAREHOUSE

WAIT_FOR_COMPLETION = FALSE | TRUE

When resizing a warehouse, you can use this parameter to block the return of the ALTER WAREHOUSE command until the resize has finished provisioning all its servers. Blocking the return of the command when resizing to a larger warehouse serves to notify you that your servers have been fully provisioned and the warehouse is now ready to execute queries using all the new resources.

Valid values

  • FALSE: The ALTER WAREHOUSE command returns immediately, before the warehouse resize completes.

  • TRUE: The ALTER WAREHOUSE command will block until the warehouse resize completes.

Default: FALSE

例如:

ALTER WAREHOUSE <warehouse_name> SET WAREHOUSE_SIZE = XLARGE WAIT_FOR_COMPLETION = TRUE;

编辑:

The Snowflake Elastic Data Warehouse

3.2.1 Elasticity and Isolation VWs are pure compute resources.

They can be created,destroyed, or resized at any point, on demand. Creating or destroying a VW has no effect on the state of the database. It is perfectly legal (and encouraged) that users shut down all their VWs when they have no queries. This elasticity allows users to dynamically match their compute resources to usage demands, independent of the data volume.