Test, inspect, and ship

Inspect SQL, plans, and data

Use generated SQL, SQLite query plans, measured data, and Drizzle Studio to diagnose queries before guessing at indexes.

8 minute lesson

~~~

Type-safe SQL can still be slow SQL. Types prove shapes, not performance.

Start with the generated statement and bound parameters. Run EXPLAIN QUERY PLAN against representative data. Drizzle Studio can help inspect rows and schema during development, but it does not replace a saved plan or a repeatable performance test.

A query over twenty rows will look fast with or without a useful index. Seed enough realistic data to expose the access pattern, then compare the plan and timing before and after the index.

Be careful with Studio against shared databases. A convenient data editor still has the authority of its credentials. Use the narrowest environment and access level that solves the debugging task.

Capture the generated SQL and query plan for one user’s newest notes. Remove the composite index, compare the evidence, restore it, and explain the plan change in plain language.

Lesson completed

Take this course offline

Get every free book and course as PDF and EPUB files.

Get the download library →