Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Wed, 30 May 2012 @ 16:26:34 GMT

  <Prev Next>  
Next> Last>>  

Subj:   Macros vs Stored Procedures for DML statements only
From:   David Clough

Just like to run this thought past you guys ...

Stored Procedures vs Macros.

On the assumption that there is no procedural code within the Stored Procedure, and there's NO Cursor processing, i.e. there's just a series of DML statements, would I be right in saying that Stored Procedures work just as fast as Macros ?

Now, you might ask 'why use a Stored Procedure for just DML statements when a Macro will do?

The answer to this is that, between DML statements, we can call a utility Procedure to Collect Stats on the Work Tables which would be used in subsequent steps of the Procedure.

This cannot be done within a Macro and has certainly led to problems in the past with incorrect Explains in the past, where no Stats were on intermediate 'work' Tables.

Yes, I know it can all be done equivalently in Bteq, but here again, would it really perform any better than a Stored Procedure, I wonder.


David Clough
Senior Database Designer
Database Design Group

  <Prev Next>  
Next> Last>>  
  Top Home Privacy Feedback  
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023