Snowflake Metadata query results
Snowflake is a columnar database and it stores the meta information of all the columns in a table. e.g, Number of rows in each partition, the total number of partitions, distinct values for the column in each partition and so on. So when you issue a command like,
SELECT COUNT(1) FROM HR.EMPLOYEE;
Snowflake just uses the metadata layer to process this information and it should return the results of the above query, without even,
- Hitting the underlying table
- Thereby saving on your compute costs
Similarly, the MAX() or MIN() functions work too without hitting the actual table.