Documentation
¶
Overview ¶
Command query_plans is Load Experiment 6: query plans at scale.
It seeds a synthetic tenant sized like a busy installation (by default 1,000 DAGs, 1,000,000 DAG runs, 5,000,000 task instances and 1,000,000 audit rows) and runs EXPLAIN (ANALYZE, BUFFERS) on the hot queries the UI, the API and the scheduler's maintenance loops issue. Each case reports the median, best and worst execution time over several runs, the FK trigger time it caused and the tables it read with a sequential scan, as a Markdown table ready for test/load/BASELINE.md.
The SQL is read from internal/storage/queries at run time, so the experiment always measures the queries that ship. Every EXPLAIN runs inside a transaction that is rolled back, so mutating cases (DeleteDag) leave the dataset intact.
The dataset belongs to a dedicated tenant and is kept between runs, since seeding takes minutes. --reseed rebuilds it and --drop removes it. Point the experiment at a throwaway database: seeding adds about 2 GB.
Usage (see test/load/README.md for the full runbook):
DATABASE_URL='postgres://leoflow:leoflow@localhost:5432/leoflow?sslmode=disable' \ go run ./test/load/query_plans