Will the above query cost you any compute credits?

create or replace table result_scan_table as

select * from table(result_scan(last_query_id()));

Will the above query cost you any compute credits?
A . It will not cost any compute credit because this query is a metadata operation
B. It will cost compute credit because processing is required to insert the data into result_scan_table
C. It will depend on the warehouse chosen

Answer: B

Explanation:

Ok, let us understand why it will use compute.

If you run this query and look at the query profile, you will see that it has executed in 3 steps

Step 1 – It executed the select query from result_scan(last_query_id(). Anything that is retrieved from result_scan is hitting the query cache and hence no compute required

Step 2 – This is where it is creating the table structure which is a metadata operation and no compute is required

Step 3 – This is where it is inserting rows into the table and it requires compute

You can expect questions on this concept. So, if you have not understood this, please go through this

one more time and do a hands-on exercise.

Important point to note

If you are asked how you will load a table from result_scan, will this hands-on help you to answer this?;

Latest ARA-C01 Dumps Valid Version with 156 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments