findTransactionPlan
Finds the first transaction plan in the tree that matches the given predicate.
This function performs a depth-first search through the transaction plan tree, returning the first plan that satisfies the predicate. It checks the root plan first, then recursively searches through nested plans.
Parameters
| Parameter | Type | Description |
|---|---|---|
transactionPlan | TransactionPlan | The transaction plan tree to search. |
predicate | (plan) => boolean | A function that returns true for the plan to find. |
Returns
TransactionPlan | undefined
The first matching transaction plan, or undefined if no match is found.
Examples
Finding a non-divisible sequential plan.
Finding a specific single transaction plan.