Snowflake Solutions Expertise and
Community Trusted By

Enter Your Email Address Here To Join Our Snowflake Solutions Community For Free

Snowflake Solutions Community

We use Stored Procedures to refresh our datamart. Should we replace them with dynamic tables?

767 viewsDynamic Tables
0

We currently use stored procedures to refresh our datamart. Would it be more efficient to replace these stored procedures with dynamic tables instead?

Daniel Steinhold Answered question May 28, 2024
0

Converting your stored procedures directly to dynamic tables might not be the most effective approach. Here's why:

Functionality: Stored procedures can perform complex logic beyond data retrieval, such as data transformations, error handling, and security checks. Dynamic tables primarily focus on retrieving data based on a definition.
Performance: For simple data retrieval, dynamic tables can be efficient. However, for complex logic, stored procedures might still be optimal, especially if they are well-optimized.
Here's a better approach:

Analyze the stored procedures: Identify the core data retrieval logic within the procedures.
Consider views: You could potentially convert the data retrieval parts of the stored procedures into views. These views can then be used by the dynamic tables or directly in your data mart refresh process.
Maintain stored procedures for complex logic: Keep the stored procedures for any complex data manipulation or business logic they perform.
This approach leverages the strengths of both techniques:

Dynamic tables for efficient data retrieval based on the views.
Stored procedures for handling complex transformations and business logic.
Ultimately, the best approach depends on the specific functionalities within your stored procedures. Evaluating each procedure and its purpose will help you decide on the most efficient way to refresh your data mart.

Daniel Steinhold Answered question May 28, 2024

Sign in with google.com

To continue, google.com will share your name, email address, and profile picture with this site.

Harness the Power of Data with ITS Solutions

Innovative Solutions for Comprehensive Data Management

Feedback on Q&A