The graph of Figure 25 shows that the delinquent design pattern
starting at preparehotel is in fact a superdelinquent, because the
total elapsed time is large and the number of subroutine calls
grows as one descends the tree from 10 calls to 1068 calls to
11748. (We applied both the Oracle SQL Tuning Advisor and
Quest SQL Optimizer, but neither recommended any changes.)
4.3.5 Table design improvement
A tuner looking at this graph would follow the critical path from
preparehotel to skuttran to insertsku and start to take a look at the
queries and the table design. Analysis of the code shows that
translations are done for each sku. The inserted description for
each sku depends on the possible language. There are 11
languages involved in the application, so each of the 1068 skus in
the 10 hotels is inserted into sku_translated table for all the 11
languages (1068 * 11 = 11748) .On the other hand, the call to the
translation routine depends only on hotel_id and room_type. (This
makes sense because the description “double bedroom with a sea
view” does not change over time.) So the denormalization of
sku_translated table is one root cause of the slow performance.
On the other hand, lots of (unshown) application code depends on
the existence of the sku_translated table, so we first consider how
to insert into it more efficiently. We do so by taking descriptions
from a table that depends only on hotel_id, room_type_id. So the
first fundamental improvement is to alter the hotel_desc table by
replacing descriptioninEN by desc_id (having values from the
domain of trans_dict.desc_id) (Figure 26).
The graph of Figure 25 shows that the delinquent design pattern
starting at preparehotel is in fact a superdelinquent, because the
total elapsed time is large and the number of subroutine calls
grows as one descends the tree from 10 calls to 1068 calls to
11748. (We applied both the Oracle SQL Tuning Advisor and
Quest SQL Optimizer, but neither recommended any changes.)
4.3.5 Table design improvement
A tuner looking at this graph would follow the critical path from
preparehotel to skuttran to insertsku and start to take a look at the
queries and the table design. Analysis of the code shows that
translations are done for each sku. The inserted description for
each sku depends on the possible language. There are 11
languages involved in the application, so each of the 1068 skus in
the 10 hotels is inserted into sku_translated table for all the 11
languages (1068 * 11 = 11748) .On the other hand, the call to the
translation routine depends only on hotel_id and room_type. (This
makes sense because the description “double bedroom with a sea
view” does not change over time.) So the denormalization of
sku_translated table is one root cause of the slow performance.
On the other hand, lots of (unshown) application code depends on
the existence of the sku_translated table, so we first consider how
to insert into it more efficiently. We do so by taking descriptions
from a table that depends only on hotel_id, room_type_id. So the
first fundamental improvement is to alter the hotel_desc table by
replacing descriptioninEN by desc_id (having values from the
domain of trans_dict.desc_id) (Figure 26).
การแปล กรุณารอสักครู่..
