Engine execution modes
You can select an execution mode that the CMDB Query Builder engine uses to run saved queries. The engine can use an enhanced mode that is based on Graph API technology, or the legacy SQL-based mode.
- V1
- Legacy SQL-based execution engine which is used when explicitly configured so and for queries with structures that aren't supported by the V2 mode.
- V2
- An enhanced query execution engine that is based on Graph API technology. This technology is designed for improved performance and scalability, and is the default execution engine in the base system. In V2 mode, compared to V1 mode, the CMDB Query Builder engine is capable of running complex queries significantly quicker and process larger result sets without performance degradation.
Settings
You can configure execution mode at the system or at the query level. When the system is configured to run queries in V2 mode, queries containing structures not supported in V2, automatically fallback to run in V1 mode. This automatic fallback mechanism ensures that all queries execute successfully while maximizing performance benefits where possible.
- System property glide.cmdb.query.execution_mode sets the system-wide default setting of the execution engine to use when a saved query's execution mode isn't set.
-
System property glide.cmdb.query.or_execution_mode sets the system-wide default setting of the execution engine to use for saved queries that contain at least one logical OR condition.
Because OR operator nodes generate coalesced and cross-product result sets, this property setting also determines the choice between distinct result formats. The results of a query with an OR operator, appear differently between the modes. In V2 mode, related results are merged into a single result item, where in V1, the same results are represented by two separate result items. In some situations, it is important to run a query using the V1 engine mode to retain the legacy format of the results in support of existing reports.
Also, when viewing the query results when V2 mode is in effect, there is no 'Load More' button to load the next batch of results.
This property has precedence over the glide.cmdb.query.execution_mode system property.
- The Query Execution Mode attribute of a saved query in the Saved Queries [qb_saved_query] table is the specific engine mode setting for the respective saved query. For more information about this setting, see Set execution mode for running a query.
For more information about the engine mode system properties, see Property settings for CMDB Query Builder.
Unsupported query structures for V2 mode
- Queries with filters containing related list conditions.
-
No relationships combined with a filter containing configuration item conditions: Node that has no relationships configured and the target node's filter has configuration item conditions.
For example:
Server NOT connected to Router WHERE Router.status = Active. - Service Mapping query with relationship edges (Related, Not Related, Belongs To, Not belongs to). Service Mapping query with service query properties set to Find Related CIs or Find Unrelated CIs, or a combination query in which a service query connection property is set to Does Not Belong to Service.
Decision flow
- Check the setting in the Query Execution Mode attribute in the query record in the Saved Queries [qb_saved_query] table:
- If 'V1': Use V1
- If 'V2': Use V2 pending support check
- If 'None': Check system properties as described in the next step
- Check system property glide.cmdb.query.execution_mode:
- If not set: Use V2 pending support check
- If 'V1': Use V1
- If 'V2':
- If no logical OR conditions: Use V2 pending support check
- If one or more logical OR conditions: Perform 'OR'-specific check as described in the next step
- Check the value of glide.cmdb.query.or_execution_mode:
- If 'V1': Use V1
- If 'V2': Use V2 pending support check
- If empty: Use V2
- Perform V2 support check:
- If the query contains a structure that isn't supported in V2: Use V1
- If query structure is supported in V2: Use V2
The Query Execution Mode attribute in table Query Status [qb_query_status] shows the execution mode for each query.