Design Optimization
You can implement few basic sstrategies for optimizing the design when working with queries.
- Reuse Existing Queries and Statements Whenever Possible
Creating a new query is an "expensive" operation. If possible, create the queries ahead of time (in a startup function), then keep reusing those existing query definitions in new statements. - Improve Performance by Pre-fetching Objects (Cache Queries)
When a query executes, objects are fetched from the cache as needed for query processing. Objects are placed in the local query cache for use by the query. You can improve performance by prefetching the objects from the backing store. See TIBCO BusinessEvents Developer’s Guide for more information. - Optimize WHERE Clause Expressions
In the where clause, ensure that the most selective operators appear first. - Use Indexing for More Efficient Cache Queries
You can index concept and event properties to make searches faster. Use of indexing avoids the need to deserialize the entire object before running the filter—indexing is of greatest value with large objects that have many properties. - Use Filtering for Efficient Joins (Cache Queries)
When performing a join between two or more entities in a query, put the most selective operators before the actual join expression. This makes the join more efficient. - Effect of the Cache on Continuous Queries
Cache queries are run against the object cache, not against the contents of working memory. Ensure that the objects you want to query are in the cache when the query is run, and are not, for example, removed from the cache before the query executes. - Effect of Time on Cache Queries
While running continuous queries, errors can occur if entity creation and deletion happen in rapid succession.
Copyright © Cloud Software Group, Inc. All rights reserved.