Re: new to cursors
Pablo Sanchez (honeypot@blueo akdb.com) writes:[color=blue]
> Erland Sommarskog <sommar@algonet .se> wrote in
> news:Xns9480365 5A9EEYazorman@1 27.0.0.1:[color=green]
>> And when many of the calls to the procedure for busieness reasons
>> are in fact one off, there may be a performance penalty of the
>> procedure is rewritten to be table-oriented.[/color]
>
> For example?[/color]
We did take to task to rewrite one of our procedures to be table-oriented.
We did this, because this one creates an account transaction, updates
positions, balances and a whole lot more things. The scope for the database
transaction for this may be a singe account transaction, for instance a
simple deposit of money. The scope may also be over 50000 account
transactions, for instance capitalization of interest, or a corporate
action in a major company like Ericsson.
The outcome of this adventure is that we can now rewrite the multi-
transaction updaets to be set-based and be a lot faster than before.
But anything that is still one-by-one due to legacy is now slower,
say one second instead of 200 ms. Instead of having single values
in variables, it is now in 43 table variables, and that is of course
slower.
--
Erland Sommarskog, SQL Server MVP, sommar@algonet. se
Books Online for SQL Server SP3 at
Pablo Sanchez (honeypot@blueo akdb.com) writes:[color=blue]
> Erland Sommarskog <sommar@algonet .se> wrote in
> news:Xns9480365 5A9EEYazorman@1 27.0.0.1:[color=green]
>> And when many of the calls to the procedure for busieness reasons
>> are in fact one off, there may be a performance penalty of the
>> procedure is rewritten to be table-oriented.[/color]
>
> For example?[/color]
We did take to task to rewrite one of our procedures to be table-oriented.
We did this, because this one creates an account transaction, updates
positions, balances and a whole lot more things. The scope for the database
transaction for this may be a singe account transaction, for instance a
simple deposit of money. The scope may also be over 50000 account
transactions, for instance capitalization of interest, or a corporate
action in a major company like Ericsson.
The outcome of this adventure is that we can now rewrite the multi-
transaction updaets to be set-based and be a lot faster than before.
But anything that is still one-by-one due to legacy is now slower,
say one second instead of 200 ms. Instead of having single values
in variables, it is now in 43 table variables, and that is of course
slower.
--
Erland Sommarskog, SQL Server MVP, sommar@algonet. se
Books Online for SQL Server SP3 at
Comment