shoc-backend/docs/work-orders/phase-4/search-tier-decision.md

51 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Search Tier Decision — Fase 4
**Data:** 2026-06-24
**Status:** Provisório (dev) — aguardando Volume Discovery staging/prod
---
## Tier confirmado
| Ambiente | Tier | Total WOs | Decisão |
|----------|------|-----------|---------|
| Dev local | **S (provisório)** | < 25k sintético | Implementar SQL filtros + paginação opcional |
| Staging | _pendente_ | _pendente acesso_ | Executar [volume-discovery-report.md](../phase-0/volume-discovery-report.md) |
| Produção | _pendente_ | _pendente acesso_ | Executar queries read-only |
---
## Estratégia por tier
| Tier | Volume | Estratégia advanced search |
|------|--------|----------------------------|
| **S** | < 25k | SQL filtros compostos + paginação default 50, max 100 |
| **M** | 25k–250k | Paginação **obrigatória** + índices covering |
| **L** | 250k–1M | Spike full-text SQL Server — **não implementar sem spike** |
| **XL** | > 1M | Documentar ARB; search externo — **não implementar** |
---
## Implementação atual (Tier S)
- `WorkOrderBoardSearchFilter` — filtro textual compartilhado (board + advanced)
- `WorkOrderAdvancedSearchDataService` — query composta com `CountAsync` + `Skip/Take`
- Índices Phase 4: `SiteCode`, `InternalWONumber`, `LifecycleStatus+ScheduledDate`
- Min 2 caracteres em `search` para evitar full-table scan
---
## Próximos passos (gate staging)
1. Executar `scripts/volume-discovery.ps1` contra staging read-only
2. Preencher tabela §3 do volume report
3. Atualizar este documento com tier real
4. Repetir load test k6 em staging; ajustar `pageSize` max se tier = M
---
## Referências
- [volume-discovery-report.md](../phase-0/volume-discovery-report.md)
- [phase-4/README.md](./README.md)
- Roadmap §10, §12 Fase 4