Archives of the TeradataForum
Message Posted: Wed, 30 May 2012 @ 16:26:34 GMT
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.
|Copyright 2016 - All Rights Reserved|
|Last Modified: 23 Jun 2019|