---
title: Tune the remaining slow data-view query tail
type: task
status: completed
description: >-
  Drive the 24 chronic medium/low data-view slow-query signals (5-55s) to closure: tune or accept
  each wide multi-year/line-axis shape, re-measure before closing.
base_uri: user:task/league/data-views/tune-data-view-slow-tail.md
created_at: '2026-09-04T08:13:46.500Z'
entity_id: e5fb0449-a816-4d93-93d0-a3b8aa598f22
finished_at: '2026-09-04T08:31:09.605Z'
observations:
  - ████████████████████████████████████████████████
  - ████████████████████████████████████████████████
owner_identity_uri: █████████████████████████
public_read: true
tags:
  - user:tag/league-xo-football.md
updated_at: '2026-09-04T09:34:23.735Z'
visibility_analyzed_at: '2026-11-05T23:49:03.803Z'
---

Drive the 24 remaining open data-view slow-query signals to closure. These are the chronic 5–55s tail left open after the acute plan-clamp cluster was fixed and closed 2026-09-04 (see observations). Tune, accept, or close each; re-measure before closing.

## State at handoff (2026-09-04)

- **24 open `██████████` signals** (`base signal list --kind ██████████ --status open`), all `libs-server/data-views/execute-data-view-request.mjs`, 17 medium / 7 low, 5,349–55,205ms. Spans 2026-08-31 → 2026-09-03, mostly user 134 (KoalatyStats), mostly path socket. Each is a DISTINCT signature (n=1) — no single shape dominates.
- **Acute cluster already resolved** (not this task): the ≥60s plan-clamp giants (eqjoinsel mis-estimate → nested-loop-with-Join-Filter rescans) fixed by league `8f8b961ac`, deployed to the running ██████ ██████ 06:55 UTC 09-04 (HEAD `10ab7caae`). Closures 128271/128270/128203/128162/127519/127569/128272 + admission 128227 carry the full diagnosis.
- **Two shapes re-measured 2026-09-04 and still slow**: 127532 (`a96e752dc7e1`, 26.7s → 9.7s) and 127880 (`78cb8914cbe9`, 9.3s → 6.6s). The plan-probe answered `disable_nested_loops:false` for both — they are wide-view cost the clamp fix does not touch, not mis-plans.
- **Objective**: advisory 5s target (user:text/league/data-views/data-view-service-objectives.md). The debug workflow's standing guidance was "leave open as standing performance debt" — this task is the decision to drive it down instead.

## Key locations

- Debug workflow: ███████████████████████████████████████████ (SQL extraction, EXPLAIN traps, known cause catalog)
- Service objectives + oracle: user:text/league/data-views/data-view-service-objectives.md (measure from data-view telemetry, never pg_stat_statements)
- League host: `ssh league` — telemetry `server-out.log` in the process manager's log directory; DB log `/var/log/postgresql/postgresql-16-main.log` (`log_min_duration_statement=2000`, auto_explain 2000); repo: the league checkout on the production host
- Local repo: repository/active/league (libs-server/data-views/, scripts/debug-data-view.mjs)
- Accept-mechanism: ACCEPTED_SLOW_QUERIES in libs-server/data-views/execute-data-view-request.mjs (one entry `da81f8407752c611` today)

## Constraints (live 2026-09-04)

- League 1 auction live until 2026-09-08: deploys allowed, RESTART drops auction sockets — no runtime restart.
- A sibling is deploying c61ffe939 (ladder_market_types 45→49): raises line-axis row counts ~9x on four player market types. Line-axis re-measures are NOT comparable to pre-deploy baselines.

## Plan

- [x] Inventory the 24 open signals against the debug workflow's known-cause catalog and the plan-probe record (which shapes still carry clamp-signature plans vs wide-view cost).
- [x] For each shape, re-measure or recover its SQL and diagnose: tune (index/plan/materialize), narrow, or accept into ACCEPTED_SLOW_QUERIES with a stated declined cost.
- [x] Close each signal with `[Fix]`, `[Process-Refinement]`, or `[Track]` — never without a real remedy or a cited follow-up, and never before re-measuring the condition.
- [x] Reconcile the service-objectives measured-distance table (user:text/league/data-views/data-view-service-objectives.md) to the post-fix 2026-09-04 state.
