The original need was for an index read to be able to return the first record that matches a condition, and the next row that doesn't match a condition - to allow running totals to be stored in the index, and using the difference in the two values to calculate deltas.
Then to allow (low cardinality) wildcards we realised that you would need to return multiple sets of paired rows. Finally similar semantics would be very useful for spotting transitions in log files etc.
The proposal is for something like:
TRANSITION(dataset, filter, flags-to-indicate-which-rows-to-return)
The flags would indicate whether you want the rows before/after a transition from false->true, and similarly before/after a transition from true to false. Syntax to be agreed.
It may only support after(false->true and true->false) on indexes in the first instance.
NOTE: Care would be taken to ensure duplicate rows were not added (e.g., if part of multiple transitions, or merging from multiple wildcarded prefixes introduced spurious transitions).