duql wildcard path segments expand from the index catalog before lowering
DecisionVerified 4 Oct 2026Holds project: dftracer-utils
Decision. The context, the choice, why, and the options that were turned down.
Context#
Queries over traces with hundreds of similar nested paths needed one term per path.
Decision#
*replaces one path segment after the first. It is allowed only as a select item (no alias), in drop/unpivot lists, and as the argument ofany()/all()in a comparison. A wildcard is aPathStepwith unquoted key"*".- Expansion (
duql/wildcard.cpp) rewrites the syntax tree incompile_programfrom a lazyLeafPathscallback (the View passes its merged catalog viaschema_tree) before lowering.any/allover a pattern become a three-valued OR/AND of plain comparisons, so pruning applies. - Order: segment by segment, numeric segments by value and before others.
- A query's automatic index build writes only checkpoints, so the path catalog (statistics tier,
require_bloom) is missing andView.columnsshows only declared fields. Wildcards on such a trace fail naming the file anddftracer_index.
Why#
Measured: wildcard filter 377 ms against a 200-term OR at 379 ms.
Rejected options#
- Expansion against derive/group columns: needs per-stage expansion.
- Implicit
anyfor a bare pattern.
Also found by searching
- duql wildcard path star segment
- wildcards on a trace fail naming the file and dftracer_index
- View.columns shows only declared fields after automatic index build
- where is wildcard expanded in duql compile_program