Menu

One function in your SELECT list is costing you the Snowflake result cache
πŸ“°

One function in your SELECT list is costing you the Snowflake result cache

DEV Community: cloudΒ·Gyan AIΒ·about 7 hours ago
#qSzxD4c6
#devtocloud#devto#dev#warehouse#query
Long article (626 words) β€” no AI summary yet.
Reading 0:00
15s threshold

A dashboard runs in under a second on Monday. By Friday the same dashboard takes forty seconds and the warehouse is awake all day. Nobody changed the query, nobody changed the data volume much, and the bill went up anyway.

The usual diagnosis is "we need a bigger warehouse". Often the real answer is that the query stopped being eligible for the result cache, and every refresh now does real work.

Three caches, and only one of them survives a suspend

Snowflake has more than one cache, and conflating them is where the reasoning goes wrong.

The result cache holds the results of previous queries. When an identical query arrives and the data has not changed, Snowflake returns the stored result β€” without starting the warehouse at all . That last part is the one people find surprising: a suspended warehouse can still answer a dashboard instantly, because no compute is involved.

The warehouse (local disk) cache lives on the running warehouse local storage.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.