Skip to content

Rewrite the indexes chapter as a hands-on tutorial - #1

Merged
alexshapalov merged 1 commit into
mainfrom
indexes-tutorial
Sep 7, 2026
Merged

Rewrite the indexes chapter as a hands-on tutorial#1
alexshapalov merged 1 commit into
mainfrom
indexes-tutorial

Conversation

@alexshapalov

Copy link
Copy Markdown
Contributor

What

  • topics/01-indexes.md rewritten as a five-step tutorial for a beginner DevOps reader: Docker lab, seq scan on a million rows, add the index, three cases where an index does not help, and what indexes cost. Each step ends with a checklist. Every SQL block was dry-run against postgres:17; ANALYZE after the load keeps the plans deterministic.
  • Renderer: ## Step N: headings draw a 1 ─ [2] ─ 3 ─ 4 ─ 5 progress tracker, - [ ] items render as ☐ / ☑, **bold** spans, and ```sql blocks get syntax colors (keywords, strings, numbers, comments, functions, psql meta-commands).
  • Bare pgbook prints an ASCII wordmark and a start-here menu. --help is unchanged.
  • site/api regenerated.

Test plan

  • go test ./..., go vet, gofmt clean
  • go run ./tools/gensite produces no diff (CI freshness check)
  • Chapter rendered through the real fetch path against tools/serve; widest line 77 columns
  • All chapter SQL executed end to end in a throwaway postgres:17 container

🤖 Generated with Claude Code

https://claude.ai/code/session_017j8szNM4ep76fVKgpoHa6A

topics/01-indexes.md is now five numbered steps: start a Postgres lab in
Docker, load a million rows and watch a seq scan, add the index, see
three cases where an index does not help, and measure what indexes
cost. Every step ends with a checklist. ANALYZE runs after the load so
the plans are deterministic; the sample plans were copied from a real
Postgres 17 run.

The terminal renderer learns the conventions the chapter uses:
"## Step N:" headings draw a 1 ─ [2] ─ 3 ─ 4 ─ 5 tracker, "- [ ]" items
render as ☐ / ☑, **bold** spans are bold, and ```sql blocks get
keyword, string, number, comment, and function colors. Bare `pgbook`
now prints an ASCII wordmark with a start-here menu instead of the
usage text; --help is unchanged.

site/api regenerated from the topic source.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017j8szNM4ep76fVKgpoHa6A
@alexshapalov
alexshapalov merged commit 9ed1ad0 into main Sep 7, 2026
1 check passed
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