Repository navigation
Commit defec8e
committed
Diff Docker manifest archs with a full join instead of an aggregate
manifest_mismatches/3 aggregated both per-arch repos' full tag histories
(GROUP BY tag + array_agg over ~1.9M rows for elixir), forcing a sort of
the whole set on every run. With work_mem below the sort's ~218MB
footprint that spills to a fast external merge, but past it the planner
switches to a single in-memory quicksort doing full locale-collated
comparisons, which is ~4x slower — the regime production runs in, at
~20s per elixir call every 15 minutes.
Tags are unique per (repo, tag), so the built-arch set is simply which
of the two per-arch repos contain the tag. A full join of two index-only
scans computes the same result with no sort or aggregate and also
parallelizes: 3.4s to 0.57s for elixir and 264ms to 9.7ms for erlang on
a production-sized snapshot, flat across work_mem settings, with the
generic prepared-statement plan holding at ~0.6s.
Verified against the old query on synthesized mismatches of every class
(missing manifest, manifest lacking a built arch, single-arch tag with
and without coverage, manifest-only tag): identical rows in both
directions.1 parent d72db9f commit defec8e
1 file changed
Lines changed: 12 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
434 | | - | |
435 | | - | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
436 | 440 | | |
437 | 441 | | |
438 | 442 | | |
439 | 443 | | |
440 | 444 | | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
446 | 451 | | |
447 | 452 | | |
448 | 453 | | |
| |||
0 commit comments