Skip to content

perf(lineage): analyse traced columns against only referenced relations - #877

Merged
kvlonge merged 2 commits into
mainfrom
perf/chi-433-column-lineage
Sep 29, 2026
Merged

kvlonge merged 2 commits into
mainfrom
perf/chi-433-column-lineage

Conversation

@kvlonge

@kvlonge kvlonge commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Why

sqb lineage <model>.<column> rebuilt the whole-project analyser schema for every traced model and passed all of it to the analyser, so cost grew with (models traced x tables in the project). On the 3,000-model diamond benchmark an upstream column trace took ~67 s.

Changes

  • Rich column lineage builds analyser table entries once per call and gives each model only the tables it references (__ref/__source/__seed, macro-expanded SQL), in the same sorted order.
  • Unit test: schema built once and each analysis sees only its referenced tables, independent of unrelated project size.
  • Two column-trace cases (upstream text, downstream JSON) in the inspection performance guard with wall, peak-RSS and output-line ceilings.

Verification

  • 3,000 models: upstream trace 67.5 s -> 5.4 s, downstream 48.8 s -> 5.4 s, peak RSS 455 -> 384 MB.
  • Whole-project rich lineage dump (3,130 models, 366,756 edges, both dialects) byte-identical; 524 fixture traces identical in text and JSON; CLI benchmark output identical.
  • make test, make check-ci, performance target under 4 GiB; one independent review.

…relations

Rich column lineage rebuilt the Polyglot schema for the whole project for
every analysed model and handed all of it to analyze_query, so a column
trace cost (models traced x project schema). Build the Polyglot table
entries once per invocation and pass each model only the relations it
references. Output is unchanged.

Refs: CHI-433
Add rich column traces upstream from the lattice rollup (text) and
downstream from the hub (JSON) to the 3,000-model inspection guard with
wall-time, peak-RSS and output-line ceilings.

Refs: CHI-433
@kvlonge
kvlonge enabled auto-merge (squash) September 29, 2026 02:54
@kvlonge
kvlonge merged commit 9655a4e into main Sep 29, 2026
29 checks passed
@kvlonge
kvlonge deleted the perf/chi-433-column-lineage branch September 29, 2026 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant