Skip to content

[rename] Give better names to each "stage" and each "pass" #1208

Open

Description

@milindsrivastava1997

These names are not descriptive:

Stage 0
Stage 1 Pass 1
Stage 1 Pass 2
Stage 2

Simply using "logical" and "physical" may also be vague, since we have different notions of logical and physical vs. traditional DB literature

Activity

  1. milindsrivastava1997 commented on Nov 4, 2026

    @milindsrivastava1997
    CollaboratorAuthor

    Another Stage 0 naming confusion, seen in asap_planner --run-until stage0 (#1190):

    Stage 0 does two things, in two crates:

    1. Lowering: each frontend (frontend-promql, frontend-sql) lowers its queries to QueryRoots, one logical DAG per query.
    2. Hash-consing: generate_dag_of_logical_memo_groups (logical-asap-optimization/src/stage0.rs) merges those DAGs into one DagOfLogicalMemoGroups, where sub-expressions the queries share become one group.

    planner-layering.md lists the hash-consing as Stage 0's job, and run_planning calls it before Pass 1. But the names only describe the first step:

    • the user guide calls Stage 0 "the query-language frontends";
    • the JSON key is stage0_query_language_frontends;
    • the hash-consing code lives in Stage 1's crate.

    So in --run-until stage0 output, the "Stage 0 → Stage 1: DagOfLogicalMemoGroups" section looks like it belongs to Stage 1. A better name for Stage 0, and maybe the hash-consing's crate, should cover both steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions