Re:Why is it so hard to avoid premature optimizations?
by Locke1689 on Wednesday July 21, 2010 @01:31PM
(#1535855)
Your example 2 is actually not as ridiculous as you state. For example, the following lines are from Market Watch Frame 1 in the TPC-E benchmark.
open stock_list
do until(stock_list.end_of_cursor) {
fetch from
stock_list cursor
into
symbol
select
new_price = LT_PRICE
from
LAST_TRADE
where
LT_S_SYMB = symbol
We spend a lot of time trying to optimize these types of OLTP transactions and in certain cases you may be better off using this structure than a more esoteric, less optimized construct.
Edit: I guess I should mention that the cursor in there is going to hurt. Just an example -- don't always actually do that and rely on us to speed up your transaction.
Edit: I guess I should mention that the cursor in there is going to hurt. Just an example -- don't always actually do that and rely on us to speed up your transaction.