The above diagram illustrates how a Virtual Warehouse executes end-user queries, which in turn are coordinated by the Cloud Services layer. This scale-out database architecture acts as the brains of the operation and automatically captures metadata about data as it's loaded, including query statistics used to tune query performance automatically. This metadata includes for every micro-partition:
- Maximum & Minimum Values: Which holds the numeric, date, or alphabetic maximum and minimum value of every column in the table. This is recorded for every micro-partition.
- Other Statistics: Which includes the count of total values, distinct values, and NULL entries, again used to maximize query performance.
Using the above techniques, Snowflake can execute several queries within milliseconds without actually needing any access to the underlying data, or even needing a virtual warehouse.