Skip to main content

Splitting Strategy

diagram

Predicate Classification

Null check predicates (for example, HAS_VALUE in Lucene syntax) are not currently functional in Powersheet query splitting. Do not rely on null-check predicates in where clauses until this is restored — use alternative filtering strategies such as explicit value matches or post-filter logic.
Predicates that can be translated to Lucene execute at the database level, reducing the number of entities fetched from Polarion. Post-filter predicates require all candidate entities to be loaded first, then filtered in memory.

Query Execution Pipeline

The query processor follows this execution order:
  1. Predicate analysis — Classify each predicate as Lucene-compatible or post-filter
  2. Lucene query construction — Combine Lucene-compatible predicates with type and project constraints
  3. Database execution — Execute Lucene query against Polarion IDataService
  4. Post-filter application — Apply remaining predicates in memory on the result set
  5. Expansion path resolution — Load related entities via expansion paths
  6. Security enforcement — Verify entity-level read permissions

Document Query Optimization

When the where clause contains document-level predicates (e.g., filtering by document properties), the query processor extracts these predicates and pre-resolves matching documents before querying work items. This reduces the work item query scope by restricting it to items within specific documents.
The exact set of predicates classified as document-level depends on the query structure. Verify query execution plans using the explain query parameter when available.

Query Parameters

The query processor extracts parameters that control query behavior. See Query Context and Baseline and Revision Queries for parameter details.

Security Enforcement

Before any query executes, the processor verifies that the current user has read permission for the queried entity type. Queries against unauthorized entity types fail immediately without executing the Lucene query.
Entity-level security is checked before any query execution. If the current user does not have READABLE permission for the entity type, the query returns an error immediately.

Constraint Annotations

The query processor applies constraint annotations from the data model to queries:
  • Project constraints from entity type annotations are merged into the Lucene query
  • Document constraints from entity type and expansion path annotations are merged into document filters
  • Navigation property constraints combine both the expansion path and target entity type constraints
See Constraints for data model constraint configuration.

Complete YAML Example

In this configuration:
  • The where clause contains a Lucene-compatible equality predicate (type:)
  • The applyCurrentDocumentTo constraint restricts results to the current document context
  • Expansion paths load related entities after the primary query executes
Last modified on July 10, 2026