Cyber Monday 2024! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Snowflake Exam DEA-C01 Topic 1 Question 19 Discussion

Actual exam question for Snowflake's DEA-C01 exam
Question #: 19
Topic #: 1
[All DEA-C01 Questions]

A company built a sales reporting system with Python, connecting to Snowflake using the Python Connector. Based on the user's selections, the system generates the SQL queries needed to fetch the data for the report First it gets the customers that meet the given query parameters (on average 1000 customer records for each report run) and then it loops the customer records sequentially Inside that loop it runs the generated SQL clause for the current customer to get the detailed data for that customer number from the sales data table

When the Data Engineer tested the individual SQL clauses they were fast enough (1 second to get the customers 0 5 second to get the sales data for one customer) but the total runtime of the report is too long

How can this situation be improved?

Show Suggested Answer Hide Answer
Suggested Answer: D

This option is the best way to improve the situation, as using a loop construct to run SQL queries for each customer is very inefficient and slow. Instead, the report should be rewritten to use a single SQL query that joins the customer and sales data tables and applies the query parameters as filters. This way, the report can leverage Snowflake's parallel processing and optimization capabilities and reduce the network overhead and latency.


Contribute your Thoughts:

Chana
6 months ago
That's true, defining a clustering key could definitely improve performance too.
upvoted 0 times
...
Hollis
6 months ago
But wouldn't defining a clustering key for the sales data table also help optimize the report?
upvoted 0 times
...
Izetta
6 months ago
I agree with Chana, looping through each customer record sequentially seems inefficient.
upvoted 0 times
...
Chana
6 months ago
I think rewriting the report to eliminate the loop construct would be the best option.
upvoted 0 times
...
Taryn
6 months ago
Increasing the number of maximum clusters of the virtual warehouse could distribute the workload better.
upvoted 0 times
...
Dorothy
6 months ago
I believe defining a clustering key for the sales data table could also make a difference.
upvoted 0 times
...
Natalie
7 months ago
But wouldn't increasing the size of the virtual warehouse also help improve the runtime?
upvoted 0 times
...
Nobuko
7 months ago
I agree with That loop might be causing the slowdown.
upvoted 0 times
...
Yolando
7 months ago
I think rewriting the report to eliminate the loop construct could be a good solution.
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77