QuestionQ79
Design and Manage Snowflake Resources and PerformanceA company developed a sales-reporting system in Python that connects to Snowflake through the Python Connector. From the user's selections, the system creates the SQL queries required to retrieve report data. It first retrieves the customers that meet the specified query parameters (averaging 1,000 customer records per report run), then sequentially iterates through those customer records. Within that loop, it runs the generated SQL clause for the current customer to retrieve detailed data for that customer number from the sales data table.
When the Data Engineer tested the individual SQL clauses, they performed quickly enough (1 second to retrieve the customers and 0.5 second to retrieve sales data for one customer), but the overall report runtime is too long.
How can this situation be improved?
Community Discussion