commit	target	description	status	domains	interaction
13b302a8	members/action.ts	findFirst->findUnique on composite index, parallel permission checks instead of loading all members (5 functions)	keep	query,structure	index-seek replaces table-scan
13b302a8	repositories/action.ts	findFirst->findUnique, parallel permission checks, select narrowing (5 functions)	keep	query,structure	index-seek replaces table-scan
13b302a8	members/data.ts	findFirst->findUnique for org lookup	keep	query	single-row PK seek
13b302a8	privacy-actions.ts	findFirst->findUnique with composite key + select	keep	query	index-seek replaces scan
13b302a8	review-optimizations/action.ts	Set-based lookup replacing Array.some	keep	cpu	O(1) vs O(n) per item
13b302a8	get-recent-traces.ts	Map-based lookup replacing Array.find in loop	keep	cpu	O(1) vs O(n) per item
13b302a8	llm-calls/page.tsx	Combined 2 sequential Promise.all into 1 parallel batch	keep	async	reduced sequential waterfall
13b302a8	traces/page.tsx	Parallelized 2 independent sequential queries	keep	async	reduced sequential waterfall
a14cd8e7	data.ts+repo-detail-client.tsx	Consolidated 2 separate count queries into single combined query	keep	query	2 roundtrips to 1
16fc8856	review-optimizations/action.ts	Narrowed repository include from all columns to 3 needed fields	keep	query	reduced data transfer
22ef695c	[traceId]/action.ts	Narrowed repository include to id,full_name,name,installation_id	keep	query	reduced data transfer
7fcbd321	llm-calls/page.tsx	Hoisted cached filter queries into main Promise.all	keep	async	eliminated waterfall stage
972846ab	members/data.ts	Eliminated redundant findUnique for current user role	keep	query	1 roundtrip eliminated
f8686933	[traceId]/action.ts	Added select:{metadata:true} to saveOptimizationChanges findUnique	keep	query	reduced data transfer
cb384315	auth0.ts	Parallelized trackUserLogin and hasCompletedOnboarding in login callback	keep	async	reduced login latency
bc715120	dashboard/action.ts	Rewrite statistics CTE to use UNION instead of 3-way OR for personal accounts	keep	query	3 index-backed scans replace bitmap OR merge
2444d1b4	dashboard/action.ts	Rewrite PR data query to use UNION CTE for personal accounts	keep	query	3 index-backed scans replace bitmap OR merge
6f9e81a6	cached-dashboard-data.ts	Select only id,name from organizations (skips description, website, github_org_id, etc.)	keep	query	reduced data transfer
6f9e81a6	dashboard/action.ts	Select only id,name from organizations in getUserOrganizations	keep	query	reduced data transfer
6f9e81a6	members/action.ts	Select only id+members from organizations in getOrganizationMembers	keep	query	reduced data transfer
6f9e81a6	members/data.ts	Select only id+members from organizations in getMembersPageInitData	keep	query	reduced data transfer
6f9e81a6	llm-call/[id]/page.tsx	Select 6 fields from optimization_errors (skips stack_trace Text column)	keep	query	reduced data transfer
6f9e81a6	get-trace-data.ts	Select only 6 consumed fields from optimization_errors (was 4, fixed to 6)	keep	query	reduced data transfer
7221d448	get-trace-data.ts	Select 12 fields from optimization_features instead of all 30+ columns	keep	query	reduced data transfer - skips large JSON/Text columns
1ef61d1e	llm-call/[id]/page.tsx	Select 22 fields from llm_calls instead of all 30 (skips messages, parsed_response, context JSON blobs)	keep	query	reduced data transfer - large JSON excluded
bcaf08b5	traces/page.tsx	Store timestamps as numbers during aggregation, convert to Date once per trace at end	keep	cpu,memory	avoids 2 Date objects per call per existing trace
f96fba76	action.ts (dashboard+repo)	Cache full_name.split("/")[0] into local variable instead of calling twice	keep	cpu	avoids duplicate string split
d6cab273	llm-calls/loading.tsx + llm-call/[id]/loading.tsx	Add streaming loading skeletons for observability pages without internal Suspense	keep	async	instant shell streaming while server component data fetches resolve
ee535ae9	dashboard/action.ts	Restructure getOptimizationPRs: LIMIT before JOIN to optimization_features/repositories	keep	query	JOINs only for ~10 result rows instead of all candidates
ab15d0b5	review-optimizations/action.ts	Wrap getRepositoriesWithStagingEvents + getAllOptimizationEvents with React cache() for request-level deduplication	keep	async,query	eliminates 7-8x duplicate calls per request (9.1s + 15.4s → 3.5s expected)
1a57228c	review-optimizations/action.ts	Rewrite getRepositoriesWithStagingEvents and getAllOptimizationEvents to use UNION queries for personal accounts	keep	query	3 index-backed scans replace bitmap OR merge (1633ms+1939ms → expected <1200ms total)
PENDING	traces/page.tsx	Rewrite getDistinctTraces as raw SQL CTE to use [trace_id, created_at DESC] index for GROUP BY	keep	query	leverages composite index for MAX aggregation (expected 616ms → <200ms)
PENDING	traces/page.tsx	Rewrite getUniqueOrganizations as raw SQL to use partial index on (organization WHERE NOT NULL)	keep	query	partial index scan replaces full table scan (expected 727-980ms → <100ms)
PENDING	common/prisma/migrations	Add partial index on optimization_features(organization) WHERE organization IS NOT NULL	keep	query	covers DISTINCT organization query with smaller index
PENDING	review-optimizations/action.ts	Fix groupBy type annotation for organization account path	keep	structure	resolve TS2345 type error
PENDING	dashboard/action.ts	Replace EXISTS subqueries with LEFT JOIN in getOptimizationPRs count query (org + personal)	keep	query	avoids row-by-row EXISTS evaluation (expected 921ms → <300ms)
PENDING	dashboard/action.ts	Replace EXISTS subqueries with LEFT JOIN in getOptimizationPRs data query (org + personal)	keep	query	avoids row-by-row EXISTS evaluation (expected 1435ms → <500ms)
PENDING	apikeys/page.tsx	Rewrite getCachedApiKeys as UNION query to avoid OR with nested EXISTS	keep	query	2 index-backed scans replace bitmap OR merge (expected 787ms → <250ms)
PENDING	common/user-functions.ts	Add getUserDashboardData to consolidate 4 separate user queries	keep	query	4 roundtrips → 2 (onboarding, privacy, isPaid, subscription)
PENDING	cached-dashboard-data.ts	Use getUserDashboardData to eliminate separate user/subscription queries	keep	query	reduces cold-load query count from 5 → 2
