SQL Scope
What this does
Section titled “What this does”The SQL editor can now consume the current Analyze context instead of forcing you to rebuild it manually.
That means you can:
- brush dies in
Analyze - stage what-if limits
- switch to
SQL - query the same scoped population directly
This is a one-way flow in alpha:
Analyze -> SQL
SQL does not push selection or limits back into Analyze yet.
Large result sets now page inside the SQL editor. You can still use raw SQL LIMIT / OFFSET when you want exact query-shaped paging yourself.
What propagates
Section titled “What propagates”When Analyze has an active lot, the SQL editor receives:
- lot id
- current notebook snapshot id
- current die selection
- active what-if limit overrides
- current test and wafer context
That scope is exposed through helper tables and views.
Helper views
Section titled “Helper views”current_scope
Section titled “current_scope”One-row summary of the propagated context.
Use it to confirm what the SQL editor thinks the current scope is.
current_scope_limits
Section titled “current_scope_limits”Notebook what-if limits for the current scope.
Columns:
test_numbertest_namelslusl
current_scope_selected_dies
Section titled “current_scope_selected_dies”The exact brushed die identities from Analyze.
Columns:
wafer_numberxy
current_scope_die
Section titled “current_scope_die”The die view filtered to the current selection.
If no selection is active, it resolves to the whole current lot.
If Analyze is pinned to a historical snapshot, this helper follows that pinned snapshot.
current_scope_test_results
Section titled “current_scope_test_results”The test_results view filtered to the current selection and enriched with the active notebook what-if limits.
Important columns:
has_scope_overridescope_limit_sourcescope_low_limitscope_high_limitraw_passscope_pass
has_scope_override and scope_limit_source tell you whether a row is using baseline limits or a notebook what-if override.
scope_pass uses the current notebook what-if limits when they exist, so it is the SQL-side way to work from the same review context as Analyze.
If Analyze is pinned to a historical snapshot, this helper follows that pinned snapshot too.
current_scope_active_test_results
Section titled “current_scope_active_test_results”The current scoped results filtered to the active Analyze test when one exists.
Use this when you want SQL to stay anchored to the same test you were just inspecting in scatter or histogram.
Suggested first queries
Section titled “Suggested first queries”SELECT * FROM current_scope;SELECT * FROM current_scope_limits ORDER BY test_number;SELECT * FROM current_scope_active_test_results LIMIT 200;SELECT test_number, test_name, COUNT(*) AS n, AVG(result) AS mean_result, SUM(CASE WHEN scope_pass THEN 1 ELSE 0 END) AS pass_count, SUM(CASE WHEN NOT scope_pass THEN 1 ELSE 0 END) AS fail_countFROM current_scope_test_resultsGROUP BY test_number, test_nameORDER BY fail_count DESC, test_numberLIMIT 20;