|
|
Archives of the TeradataForum
Message Posted: Thu, 18 Dec 2003 @ 15:11:54 GMT
Subj: | | Re: Tearadata SP and ASP |
|
From: | | Dieter Noeth |
Doug Little wrote:
| "Regarding cursors, every DBMS has performance problems with cursors, because cursors are processed serially, whereas a DBMS is
optimized for set operations. On Teradata it's especially bad, because a SP runs on one node only using a single CPU." | |
| If teradata sp's are executed concurrently from different sessions, or within the same session, will they execute concurrently or
serially? | |
Of course they will be executed concurrently (unless they block each other). The SQL part of a SP will run in parallel like always. But
e.g. the control loops run on one node using one CPU. And a cursor is processed row by row on that node.
| Typically sp's are small row level processes that are being executed by triggers and/or clients. So the parallelism comes from
having multiple calling clients, not from within the dbms. | |
It is similar to macros:
As long as they don't block each other everything's fine.
And as long as a SP is only processing some rows with a cursor it's not that bad, my statement was mainy about those SPs from hell
(usually by former Access programmers) processing thousands or millions of rows.
It's sometimes just easier to write some complex stuff using cursors instead of using plain SQL, but you can rewrite almost all of those
cursors to plain SQL and it's usually worth the effort.
Btw, you still can't call a SP from within a Trigger.
Dieter
| |