Hi guys, Performance question: Is snowflake able to pick up that two queries that are being run at approximately the same time are using the same sub-query? For example, the two queries below both have a subquery to find the max date in the same table. The table is 2 TB and so this computation alone is taking about 10 mins on an XL cluster. The data in the table only updates once a night. However, I use the maxdate of the table often, so I am wondering: Each time I ask for the max date, does snowflake re-scan the data, if the dataset has not changed since the last run? What if the queries are running simultaneously? Can one query leverage the work of the other? (An obvious step to take here, on my part, is to create a table storing this info, which is what query 5113bf6f below does. However, my question is in regards to general performance around sub-queries) Thanks, Rick ## Sample Querries: a6df33ed-00ab-40de-a1c1-e3f34af13a1d 5113bf6f-92b4-4db4-a2b3-dbcefc94988e Shared subquery: SELECT max(tmstamp)::date as maxDate FROM spotify.sos_from_raw_view a6df33ed-00ab-40de-a1c1-e3f34af13a1d SELECT maxDate, friday_weekof(dateadd(day, -5, maxDate)) as maxFriday FROM ( SELECT max(tmstamp)::date as maxDate FROM spotify.sos_from_raw_view ) 5113bf6f-92b4-4db4-a2b3-dbcefc94988e SELECT maxDate, friday_weekof(dateadd(day, -5, maxDate)) as maxFriday, current_timestamp() as last_updated FROM ( SELECT max(tmstamp)::date as maxDate FROM spotify.sos_from_raw_view ) ;