{
  "id": "bbg-p0155-database-performance-indexing-database-performance",
  "title": "SQL Logical Clause Order",
  "chapter": "database-performance-indexing",
  "batch": "29",
  "rank": 285,
  "sourcePage": 155,
  "sourcePointer": "p. 155",
  "status": "accepted",
  "reviewerStatus": "reviewed",
  "fidelityScore": 0.9,
  "canvas": {
    "width": 960,
    "height": 640
  },
  "fireworksTechGraph": {
    "style": "style-1-flat-icon",
    "diagramType": "flowchart",
    "topologyNotes": [
      "source page render inspected",
      "extracted page text inspected",
      "source page render inspected",
      "preserve SQL logical order visual: FROM and JOIN build row set before WHERE, GROUP BY, HAVING, SELECT, ORDER BY, and LIMIT",
      "omit copied table illustrations and raw column names"
    ],
    "publicBoundary": [
      "original vector output",
      "no source pixels",
      "no source mark or long wording"
    ]
  },
  "callouts": [],
  "sourceReview": {
    "conceptAnchors": [
      "concept: FROM source rows",
      "concept: JOIN combined rows",
      "concept: WHERE filter",
      "concept: GROUP BY and HAVING",
      "concept: SELECT projection",
      "concept: ORDER BY and LIMIT"
    ],
    "labelSource": "curated",
    "semanticStatus": "reviewed"
  },
  "groups": [
    {
      "id": "inputs",
      "label": "Input relations",
      "x": 60,
      "y": 124,
      "w": 172,
      "h": 392
    },
    {
      "id": "logical",
      "label": "Logical processing order",
      "x": 304,
      "y": 124,
      "w": 594,
      "h": 392
    }
  ],
  "shapes": [
    {
      "id": "tables",
      "kind": "table",
      "label": "Tables",
      "detail": "source rows",
      "x": 100,
      "y": 160,
      "w": 94,
      "h": 80,
      "tone": "blue"
    },
    {
      "id": "joined",
      "kind": "table",
      "label": "Row set",
      "detail": "joined",
      "x": 100,
      "y": 318,
      "w": 94,
      "h": 80,
      "tone": "purple"
    },
    {
      "id": "from",
      "kind": "rect",
      "label": "FROM",
      "detail": "choose table",
      "x": 358,
      "y": 152,
      "w": 106,
      "h": 48,
      "tone": "blue"
    },
    {
      "id": "join",
      "kind": "rect",
      "label": "JOIN ON",
      "detail": "combine",
      "x": 524,
      "y": 152,
      "w": 106,
      "h": 48,
      "tone": "blue"
    },
    {
      "id": "where",
      "kind": "rect",
      "label": "WHERE",
      "detail": "filter",
      "x": 690,
      "y": 152,
      "w": 106,
      "h": 48,
      "tone": "green"
    },
    {
      "id": "group",
      "kind": "rect",
      "label": "GROUP BY",
      "detail": "aggregate",
      "x": 358,
      "y": 282,
      "w": 106,
      "h": 48,
      "tone": "orange"
    },
    {
      "id": "having",
      "kind": "rect",
      "label": "HAVING",
      "detail": "filter groups",
      "x": 524,
      "y": 282,
      "w": 106,
      "h": 48,
      "tone": "orange"
    },
    {
      "id": "select",
      "kind": "rect",
      "label": "SELECT",
      "detail": "project",
      "x": 690,
      "y": 282,
      "w": 106,
      "h": 48,
      "tone": "purple"
    },
    {
      "id": "order",
      "kind": "rect",
      "label": "ORDER BY",
      "detail": "sort",
      "x": 444,
      "y": 414,
      "w": 106,
      "h": 48,
      "tone": "teal"
    },
    {
      "id": "limit",
      "kind": "rect",
      "label": "LIMIT",
      "detail": "trim",
      "x": 610,
      "y": 414,
      "w": 106,
      "h": 48,
      "tone": "gray"
    }
  ],
  "connectors": [
    {
      "from": "tables",
      "to": "from",
      "label": "read",
      "flow": "main"
    },
    {
      "from": "from",
      "to": "join",
      "label": "join",
      "flow": "main"
    },
    {
      "from": "join",
      "to": "where",
      "label": "rows",
      "flow": "main"
    },
    {
      "from": "where",
      "to": "group",
      "label": "filtered",
      "flow": "main"
    },
    {
      "from": "group",
      "to": "having",
      "label": "groups",
      "flow": "main"
    },
    {
      "from": "having",
      "to": "select",
      "label": "project",
      "flow": "main"
    },
    {
      "from": "select",
      "to": "order",
      "label": "sort",
      "flow": "main"
    },
    {
      "from": "order",
      "to": "limit",
      "label": "limit",
      "flow": "main"
    },
    {
      "from": "join",
      "to": "joined",
      "label": "intermediate",
      "flow": "data",
      "dashed": true
    }
  ]
}
