发布

  • [NA] [BE] Cost Intelligence query optimization: single-pass lane breakdowns (#7232)

    frostbyte_neo 发布于 2026-06-24 13:41:04 +00:00

    Collapse the per-lane AI-spend breakdown fan-out (one ClickHouse query per
    lane, each re-reading and re-parsing the large cipx span metadata blob) into
    a single combined query that runs the blocks fan-out once and emits every
    lane's breakdown. ~11x faster on representative data; output is identical to
    the per-lane queries (validated against ClickHouse).

    The per-lane label / definition / lane projections are rendered from the
    existing INPUT_LANE_CONFIGS / OUTPUT_LANE_CONFIGS so the projection stays
    single-source. tier_chars (the allocation denominator) is unchanged, so
    allocations match the per-lane path exactly.

    Adds POST /v1/private/ai-spend/composition/breakdowns returning
    SpendBreakdownsResponse. The per-lane endpoint is retained for compatibility.

    下载附件