The following are Siebel configuration best practices to keep in mind when creating or modifying calculated fields on Business Components.
- Avoid setting Force Active = TRUE or Link Specification = TRUE as this will result in the calculated field always being evaluated whenever the BC is instantiated. This in turn results in any dependant fields being evaluated hence causing additional database calls.
避免设置属性Force Active = TRUE 或 Link Specification = TRUE使每次BC实例化时calcualted field都会被运算。这样每次都会导致运算依赖的field产生额外的数据库调用。
- Avoid using InvokeServiceMethod in calculated fields. Especially avoid setting Force Active = TRUE or Link Specification = TRUE for InvokeServiceMethod calculated fields. Whenever the calculated field is active it will make a business service call, the business service will be repeatedly called for each record in the current instance context. This obviously becomes exponentially worse if there are one or more queries within the business service as additional db calls are made each time the business service is invoked.
避免使用InvokeServiceMethod来计算fields，尤其要避免为InvokeServiceMethod计算字段设置Force Active = TRUE或Link Specification=TRUE。每次这样的计算字段活动时，会调用bs，在当前实例环境下，每一条记录都会重复地调用bs。如果在bs中有一个或多个请求，bs每次被调用都会有额外的数据库调用，这显然会导致性能指数级变坏。
- If InvokeServiceMethod must be used in calculated fields then assess whether the business service can be cached (In Tools > Busines Service, set Cache = Y), this way the business service will not have to be repeatedly instantiated.
- Avoid using calculated fields with SUM and COUNT. Using the SUM and COUNT functions in calculated fields will result in an additional query generated for each record in the current instance. Again especially avoid setting Force Active = TRUE or Link Specification = TRUE for these aggregate function calculated fields as the additional query will be generated for every record whenever the BC is instantiated and queried. If you are using the COUNT or SUM function to determine if child BC records exist for a particular parent record then use the EXISTS function instead, EXISTS has much better performance.
避免在计算字段中使用SUM和COUNT，在计算字段使用SUM和COUNT函数会在当前实例的每条记录上产生额外的查询请求。尤其反对在聚集函数计算字段上设置Force Active = TRUE 或 Link Specification = TRUE，这样会导致bc在每次实例化合查询的时候每条记录都会产生附加的查询；如果你通过COUNT或SUN函数来确定子BC和父记录关联的记录是否存在，那么应使用exists来代替，EXISTS有很好的性能。
- Avoid using calculated fields in search specifications or search expressions. This may result in Siebel firstly querying on the search specification/expression without the calculated field first and then again filter against this result set in memory against the calculated field. This has potential for severe performance problems.
来自 “ ITPUB博客 ” ，链接：http://blog.itpub.net/158493/viewspace-690197/，如需转载，请注明出处，否则将追究法律责任。