# mdalmaruf/database-indexing architecture

> Architecture diagram of the GitHub repository mdalmaruf/database-indexing, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mdalmaruf/database-indexing
- Repository: https://github.com/mdalmaruf/database-indexing

## Overview

This repository is a hands-on MySQL indexing lesson, not an application. The documented workflow takes a slow customer-orders query from diagnosis through indexing and performance comparison. The README describes running SQL in Workbench and interpreting results; the available source excerpts do not show the SQL file or notebook contents, so links to those artifacts are marked unverified where necessary.

Main entry points: [`README.md`](https://github.com/mdalmaruf/database-indexing/blob/main/README.md) (Activity guide), [`Database_Indexing_Activity.sql`](https://github.com/mdalmaruf/database-indexing/blob/main/Database_Indexing_Activity.sql) (SQL activity), [`Database_Indexing_Activity.docx`](https://github.com/mdalmaruf/database-indexing/blob/main/Database_Indexing_Activity.docx) (Printable handout), [`Database_Indexing_Activity.ipynb`](https://github.com/mdalmaruf/database-indexing/blob/main/Database_Indexing_Activity.ipynb) (Notebook version)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_lesson["Lesson materials"]
  node_readme["Activity guide<br/>[README.md]"]
  node_handout["Printable handout"]
  node_notebook["Notebook version"]
end

subgraph group_workflow["Indexing exercise"]
  node_sql["SQL activity"]
  node_setup["Build dataset<br/>[README.md]"]
  node_baseline["Run slow query<br/>[README.md]"]
  node_diagnosis["Inspect query plan<br/>[README.md]"]
  node_indexing["Add indexes<br/>[README.md]"]
  node_comparison["Compare performance<br/>[README.md]"]
end

subgraph group_runtime["Database runtime"]
  node_mysql[("MySQL server")]
  node_results["Query results"]
end

node_learner(("Learner"))
node_workbench["MySQL Workbench"]

node_learner -->|"reads"| node_readme
node_learner -->|"runs SQL"| node_workbench
node_readme -->|"describes"| node_setup
node_readme -->|"describes"| node_baseline
node_readme -->|"explains"| node_diagnosis
node_readme -->|"guides"| node_indexing
node_readme -->|"explains"| node_comparison
node_readme -.->|"offers"| node_handout
node_readme -.->|"offers"| node_notebook
node_sql -.->|"run in"| node_workbench
node_workbench -->|"executes on"| node_mysql
node_setup -->|"creates data"| node_mysql
node_baseline -->|"queries"| node_mysql
node_diagnosis -->|"inspects plan"| node_mysql
node_indexing -->|"changes indexes"| node_mysql
node_comparison -->|"measures query"| node_mysql
node_mysql -->|"returns"| node_results

click node_readme "https://github.com/mdalmaruf/database-indexing/blob/main/README.md"
click node_handout "https://github.com/mdalmaruf/database-indexing/blob/main/Database_Indexing_Activity.docx"
click node_notebook "https://github.com/mdalmaruf/database-indexing/blob/main/Database_Indexing_Activity.ipynb"
click node_sql "https://github.com/mdalmaruf/database-indexing/blob/main/Database_Indexing_Activity.sql"
click node_setup "https://github.com/mdalmaruf/database-indexing/blob/main/README.md"
click node_baseline "https://github.com/mdalmaruf/database-indexing/blob/main/README.md"
click node_diagnosis "https://github.com/mdalmaruf/database-indexing/blob/main/README.md"
click node_indexing "https://github.com/mdalmaruf/database-indexing/blob/main/README.md"
click node_comparison "https://github.com/mdalmaruf/database-indexing/blob/main/README.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_readme,node_handout,node_notebook toneBlue
class node_sql,node_setup,node_baseline,node_diagnosis,node_indexing,node_comparison toneAmber
class node_mysql,node_results toneMint
class node_learner,node_workbench toneIndigo
```

## Components

### Lesson materials

- [Activity guide](https://github.com/mdalmaruf/database-indexing/blob/main/README.md): `README.md`
- [Printable handout](https://github.com/mdalmaruf/database-indexing/blob/main/Database_Indexing_Activity.docx): `Database_Indexing_Activity.docx`
- [Notebook version](https://github.com/mdalmaruf/database-indexing/blob/main/Database_Indexing_Activity.ipynb): `Database_Indexing_Activity.ipynb`

### Indexing exercise

- [SQL activity](https://github.com/mdalmaruf/database-indexing/blob/main/Database_Indexing_Activity.sql): `Database_Indexing_Activity.sql`
- [Build dataset](https://github.com/mdalmaruf/database-indexing/blob/main/README.md): `README.md`
- [Run slow query](https://github.com/mdalmaruf/database-indexing/blob/main/README.md): `README.md`
- [Inspect query plan](https://github.com/mdalmaruf/database-indexing/blob/main/README.md): `README.md`
- [Add indexes](https://github.com/mdalmaruf/database-indexing/blob/main/README.md): `README.md`
- [Compare performance](https://github.com/mdalmaruf/database-indexing/blob/main/README.md): `README.md`

### Database runtime

- **MySQL server**
- **Query results**

### Other components

- **Learner**
- **MySQL Workbench**

## Connections

- Learner → Activity guide: reads (evidence: `README.md`)
- Learner → MySQL Workbench: runs SQL (evidence: `README.md`)
- Activity guide → Build dataset: describes (evidence: `README.md`)
- Activity guide → Run slow query: describes (evidence: `README.md`)
- Activity guide → Inspect query plan: explains (evidence: `README.md`)
- Activity guide → Add indexes: guides (evidence: `README.md`)
- Activity guide → Compare performance: explains (evidence: `README.md`)
- Activity guide → Printable handout: offers
- Activity guide → Notebook version: offers
- SQL activity → MySQL Workbench: run in
- MySQL Workbench → MySQL server: executes on (evidence: `README.md`)
- Build dataset → MySQL server: creates data (evidence: `README.md`)
- Run slow query → MySQL server: queries (evidence: `README.md`)
- Inspect query plan → MySQL server: inspects plan (evidence: `README.md`)
- Add indexes → MySQL server: changes indexes (evidence: `README.md`)
- Compare performance → MySQL server: measures query (evidence: `README.md`)
- MySQL server → Query results: returns (evidence: `README.md`)
