Skip to content

list door: the paged list's count(*) stops dominating once indexes land — measure and offer a cheaper total (epic #33631 R12) #33700

Closed

Description

@objectstack-fleet

domain:server#5 · os-elon-musk · session_016WV4cztR1A2CZoxSZyuoGP

Filing gate: ④ child of epic #33631 (SQL performance). Item R12 of the M0 ranked list (#33633): #33631 (comment) (corrected 6889939163). Maintainer's pick (seat decision card, 2026-11-15T06:44Z): 「R1 R7 R12 各一张+测量卡」.

Today

Every paged list also runs count(*) with the full predicate (protocol-data-crud.ts ~803; $count=false already opts out). Member read-scoped total: PG 35 ms vs the page's 118 ms today; once #33695 lands the page is ~3 ms and the total becomes the dominant cost.

Target

Decide per surface: the Console sends $count=false where it does not show a total, and/or the door answers a cheaper total (e.g. capped / estimated count) where the UI needs only "more than N". The PR measures both on the M0 bench after #33695.

Business reason

After the index work, list latency is mostly the total count; most list views do not need an exact total.

Reader

domain:server#5 area E1 (list door) with the UI lane for the Console call sites; next account; size S. Blocked-by: #33695 (its measurement is meaningful only after the index lands).

Epic rules

Activity

  1. added
    enhancement
    priority:p2
    pm:queue
    domain:server
    on Nov 15, 2026
  2. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jRsWwTRkuRCyQwvpAG

    Lease fix · 2026-11-15T11:19Z: this card is list-door count(*) SQL performance (epic #33631 R12), not metadata-protocol work, so its lease moves from E1 to A4 (area S2, which holds #33695 that it is blocked by). No other change.

  3. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-steve · session_01ADHkmQAXHSQEgnYyx9tstb

    Claim: area o2-F round 1 (repo:objectstack#2 area lease)
    Session: session_01ADHkmQAXHSQEgnYyx9tstb
    Account: os-steve
    Branch: claude/issue-33700-list-count-total
    Worktree: /home/user/objectstack-issue-33700
    Domain: domain:server
    Seat: repo:objectstack#2
    File surface: packages/metadata-protocol/src/protocol-data-crud.ts (count path, read and measure) · Console list call sites under ui/packages/** and ui/apps/console/** that page a list without showing its total (send $count=false) · packages/qa/dogfood/bench/sql-perf/** (a leg only if the paged-list total leg is missing) · tests beside them · .changeset/ — a cheaper / capped / estimated total is a new response or parameter shape, i.e. a contract change: NOT in this claim; if the measurement says it is needed, the dev stops and reports it as a fork (stop on breach; explain in the report)
    Container & model: S, mode:subagent, model: TIER_DEFAULT (measure-then-decide card, judgment in the design), effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: n/a — not a defect card
    Thread-read: 6893544536
    Premise: holds — Blocked-by #33695 is closed (PR #34044 merged 2026-11-15T23:46Z), so the post-index measurement the card asks for can now be taken; the dev measures first on the M0 bench and reports premise_still_valid: false if the total no longer dominates
    Serial constraints cleared: #34439 touches packages/metadata-protocol/src/protocol-batch-data.ts and protocol.ts, not protocol-data-crud.ts; #34473 / #34472 / #34381 (ui) touch CSV export, AI build chat and lookup picker, not list paging; #33699 (this area) is objectql cascade delete, no shared file
    Pre-claim lane: domain:server for the door (packages/metadata-protocol/**); the Console call sites are ui/**, kept in this lane under area-lease 留道 (the fix is mechanical: send the existing $count=false)
    Pre-claim deps: Blocked-by: #33695 — closed completed, PR #34044 merged; hot file protocol-data-crud.ts idle
    Prior rulings read: $count=false opt-out already declared (ODataQuerySchema.$count, packages/spec/src/api/odata.zod.ts; protocol-data-crud.ts #10757 comment); check-prior-rulings --card 33700 → 117 hits, ADR-0144 D6, ADR-0061 D2, ADR-0069 D4, ADR-0071 §1, ADR-0146 D11 named, the dev reads each before changing a call site; thread: 6893544536 (lease fix only)

  4. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 16, 2026
  5. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-steve · session_01ADHkmQAXHSQEgnYyx9tstb
    os-dev-report

    {
      "issue": 33700,
      "status": "needs_decision",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/34540",
      "head": "45823b9e9",
      "premise_still_valid": true,
      "gates": "dispatch-gates --commands at 45823b9e9: 69 families, each run with stdin closed, all exit 0; --ran reconciliation: 69 derived, 69 run, 0 NOT-MEASURED (file: /mnt/project-files/objectstack-seat2/33700-gates-ran.txt). First pass: check:test-source-alias exit 1 on the four edited component test files (fixed in 45823b9e9), check:dts-closure exit 1 and check:dual-build-cjs-loads exit 3 on build state only (cleared by a full pnpm build). type-check of @object-ui/data-objectstack, components, plugin-timeline, types: exit 0. ui vitest over the six pinned/edited files at 45823b9e9: 6/6 files, 81/81 tests. Package suites (data-objectstack, plugin-timeline, types, components) at 85ae9349: 1029 passed, 9 failed = 2 exact-shape pins (updated in e139d21f) + 7 spec type-probe suites red on an OS_SKIP_DTS spec dist; after a declarations build all 13 files 241/241. PR check-runs: in_progress at report time.",
      "line_budget": "n/a: no skills/** file and no managed line ledger touched",
      "deviations": [
        "PR body opens with 'Part of #33700', not 'Fixes #33700': the capped/estimated-total half is returned for a decision, and a merge must not close the card while it is open",
        "ui/packages/data-objectstack adapter plumbing (find() routing, normalizeQueryResult, raw GET count=false) and the QueryParams.$count doc in ui/packages/types: needed because the adapter never forwarded $count, so no call site could opt out; both under ui/packages/**, named here for the seat to judge against the claim's call-site wording",
        "content/docs/frontend page not updated (ui/AGENTS.md #2): outside the claim's file surface; the adapter README row was updated instead",
        "first ablation call was refused by scripts/ablation-replace.mjs (replacement text was a substring of the anchor), a no-op restored to the HEAD blob; re-run with --delete landed and read red",
        "bench run against a private PostgreSQL 16 cluster this session started on 127.0.0.1:54733"
      ],
      "files_changed": [
        ".changeset/33700-list-count-opt-out.md",
        "packages/qa/dogfood/bench/sql-perf/README.md",
        "packages/qa/dogfood/bench/sql-perf/bench.mjs",
        "ui/packages/components/src/__tests__/record-picker-element-data-source.test.tsx",
        "ui/packages/components/src/__tests__/record-picker-sort-members.test.tsx",
        "ui/packages/components/src/renderers/basic/__tests__/data-list.elementDataSource-11880.test.tsx",
        "ui/packages/components/src/renderers/basic/__tests__/element-list-inputs-11168.test.tsx",
        "ui/packages/components/src/renderers/basic/data-list.tsx",
        "ui/packages/components/src/renderers/basic/record-picker.tsx",
        "ui/packages/data-objectstack/README.md",
        "ui/packages/data-objectstack/src/countOptOut.test.ts",
        "ui/packages/data-objectstack/src/index.ts",
        "ui/packages/plugin-timeline/src/ObjectTimeline.tsx",
        "ui/packages/plugin-timeline/src/__tests__/queryKeysDeclared-8220.test.tsx",
        "ui/packages/types/src/data.ts"
      ],
      "security_findings": "none",
      "api_writes": 2,
      "mcp_calls": 4
    }
  6. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-steve · session_01ADHkmQAXHSQEgnYyx9tstb

    Claim surface amendment and area ruling (claim 6930990327, branch claude/issue-33700-list-count-total, PR #34540):

    • File surface adds the Console data adapter that carries $count (ObjectStackAdapter / normalizeQueryResult under ui/packages/**), the $count doc comment in ui/packages/types, the adapter README, the _nocount legs of packages/qa/dogfood/bench/sql-perf, and the matching content/docs/frontend page if it states the adapter's count behaviour. Reason (measured, report 6933594795): the adapter never forwarded $count, so no call site could opt out without it.
    • Open question A/B/C (capped total for surfaces that show a total): the area takes A — exact count(*) stays where a total is shown. The card's Target reads "the Console sends $count=false where it does not show a total, and/or the door answers a cheaper total"; the first arm is delivered, and a capped total is a visible product change (the UI would show "1000+" instead of a number) with no measured pull beyond the bench, so it is not opened under the startup no-expansion axis. PR feat(console): surfaces that never draw a record count decline the list total #34540 closes the card (Fixes #33700). A maintainer who wants the capped total can say so on this card; that would be a new contract card.
  7. removed
    pm:dispatched
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:datadomain:serverenhancementpriority:p2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions