Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Snowflake Task cost estimation

I have a generic question about Snowflake Cost Estimation. I have a task which is schedule to execute every 5 min

CREATE TASK mytask1
  WAREHOUSE = mywh
  SCHEDULE = '5 minute'
WHEN
  SYSTEM$STREAM_HAS_DATA('MYSTREAM')
AS
  INSERT INTO ... ;

In case if there is no new data in mystream, In that case the task will be skipped. However will it be costing any money as the task is still runinng.

Please suggest

like image 958
danD Avatar asked Jun 26 '26 08:06

danD


1 Answers

CREATE TASK:

SYSTEM$STREAM_HAS_DATA

Validating the conditions of the WHEN expression does not require a virtual warehouse. The validation is instead processed in the cloud services layer. A nominal charge accrues each time a task evaluates its WHEN condition and does not run. The charges accumulate each time the task is triggered until it runs. At that time, the charge is converted to Snowflake credits and added to the compute resource usage for the task run.

Generally the compute time to validate the condition is insignificant compared to task execution time. As a best practice, align scheduled and actual task runs as closely as possible. Avoid task schedules that are wildly out of synch with actual task runs. For example, if data is inserted into a table with a stream roughly every 24 hours, do not schedule a task that checks for stream data every minute. The charge to validate the WHEN expression with each run is generally insignificant, but the charges are cumulative.

Note that daily consumption of cloud services that falls below the 10% quota of the daily usage of the compute resources accumulates no cloud services charges.

like image 123
Lukasz Szozda Avatar answered Jun 30 '26 08:06

Lukasz Szozda



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!