Query tables introduce a clean programming model for developing client applications that retrieve lists of human tasks and BPEL processes in Business Process Choreographer. Using query tables improves the performance. Information is provided about the query table API parameters and other factors that affect the performance.
The following table provides information about the query performance impact of options that are defined on composite query tables. It also provides information other topics related to composite query table definitions. The impact given in column Performance Impact is an average performance impact, actual impact observations may vary.
| Object or topic | Performance impact | Description |
|---|---|---|
| Query table filter | Negative | Filters on query tables are the filters with the highest negative impact on query performance. These filters typically cannot use any defined indexes in the database. |
| Primary query table filter | Positive | A filter on the primary query table provides high performance filtering at a very early stage of the query result set calculation. It is suggested to restrict the contents of the query table using a primary query table filter. |
| Authorization filter | Positive | A filter on authorization can improve the performance of the query, such as how the primary query table filter improves it. If possible, an authorization filter should be applied. For example, if reader work items should not be considered, specify WI.REASON=REASON_READER. |
| Selection criteria | None | Some primary query table to attached query table relationships require the definition of a selection criterion in order to meet the one-to-one or one-to-zero relationship. A selection criterion typically has low performance impact because it is evaluated for a small numbers of rows only. |
| Parameters | None | Currently, using parameters in query tables has no negative performance impact. Nevertheless, parameters should be used only if needed. |
| Instance-based authorization | Negative | If instance-based authorization is used, each object in the query table must be checked against the existence of a work item. Work items are represented as entries in the WORK_ITEM query table. This verification affects performance. |
Instance-based authorization:
|
Negative | Each type of work item that is specified for use in the query table has a performance impact. Applications with high volume queries should only use individual and group work items, or only one of those. Inherited work items are usually not required, in particular when defining task lists that return human tasks representing to-dos. They should be used only when it is clear that they are needed, for example, to return lists of tasks that belong to a BPEL process where a person might have read access based on the authorization for the enclosing BPEL process. |
| Role-based authorization or no authorization | None | If role-based authorization or no authorization is used, checks against work items are not made. |
| Number of defined attributes | Currently none | Currently, the number of attributes contained in a query table has no impact on performance. Nevertheless, only those attributes that are needed should be part of a query table. |
The following table provides information about the query performance impact of options that are specified on the query table API. The impact given in the Performance impact column is an average performance impact; actual impact observations may vary.
| Option | Performance impact | Description |
|---|---|---|
| Selected attributes | Negative (less is better) | The number of attributes that are selected when a query is run on a query table impacts on the number that need to be processed both by the database and by the Business Process Choreographer query table runtime. Also, for composite query tables, information from attached query tables need be retrieved only if those are either specified by the selected attributes or referenced by the query table filter or by the query filter. |
| Query filter | Negative | If specified, the query filter currently has the same performance impact as the query table filter. However, it is a good practice if filters are specified on query tables rather than passed into the query table API. |
| Sort attributes | Negative | The sorting of query result sets is an expensive operation, and database optimizations are restricted if sorting is used. If not needed, sorting should be avoided. Most applications require sorting, however. |
| Threshold | Positive | The specification of a threshold can greatly improve the performance of queries. It is a best practice to always specify a threshold. |
| Skip count | Negative | Skipping a particular number of objects in the query result set is expensive and should be done only if required, for example when paging over a query result. |
| Time zone | None | The time zone setting has no performance impact. |
| Locale | None | The locale setting has no performance impact. |
| Distinct rows | Negative | Using distinct in queries has some performance impact but might be necessary in order to retrieve non-duplicate rows. This option impacts only on row based queries and is ignored otherwise. |
| Count queries | Positive | If only the total number of entities or the number of rows for a particular query is needed, that is, the contents are not needed for all entries of the query table, the method queryEntityCount or queryRowCount should be used. The Business Process Choreographer runtime can apply optimizations that are valid only for count queries. |
| Item | Description |
|---|---|
| Number of query tables on the system | The number of query tables which are deployed on a Business Process Choreographer container does not influence the performance of query table queries. Also, currently, it does not influence the navigation of BPEL process instances, nor does it have impact on claim or complete operations on human tasks. Due to maintainability, keep the number of query tables at a reasonable level. Typically, one query table represents one task list or process list which is displayed on the user interface. |
| Database tuning | Although optimized SQL is used to access the
contents of a query table, database tuning needs to be
implemented on a Business Process Choreographer database:
|