We currently use stored procedures to refresh our datamart. Would it be more efficient to replace these stored procedures with dynamic tables instead?
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.