Fix N+1 queries in sessão/relatórios and remove unused painel views - #3849
Open
edwardoliveira wants to merge 1 commit into
Open
Fix N+1 queries in sessão/relatórios and remove unused painel views#3849edwardoliveira wants to merge 1 commit into
edwardoliveira wants to merge 1 commit into
Conversation
Performance-only slice extracted from feat/rate-limiter-2026 (commit 2f2a976), which bundled query-optimization work in with unrelated rate-limiter/caching changes. - customize_link_materia() and the Ordem do Dia / Expediente ListViews now use prefetched querysets instead of per-row queries. - get_etiqueta_protocolos() batch-fetches MateriaLegislativa and DocumentoAdministrativo instead of querying per protocolo in a loop. - New migration redefines the materia_materiaemtramitacao view and adds a concurrent index (tram_materia_id_desc) backing the tramitacao prefetch. - Drops a redundant .distinct() + order_by on a related field in RelatorioMateriasTramitacaoFilterSet.qs. - Removes the unused painel_mensagem/parlamentar/votacao views and templates (also bundled into 2f2a976 by mistake). - Adds CLAUDE.md project documentation. Note: feat/painel-votacao-v2 still imports painel_mensagem_view, painel_parlamentar_view and painel_votacao_view. That branch will need reconciling with this removal when it's rebased onto 3.1.x. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
edwardoliveira
force-pushed
the
feat/sessao-relatorio-perf
branch
from
August 7, 2026 20:26
f37c574 to
9269bc1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Performance-only slice extracted from feat/rate-limiter-2026 (commit 2f2a976), which bundled query-optimization work in with unrelated rate-limiter/caching changes.
Note: feat/painel-votacao-v2 still imports painel_mensagem_view, painel_parlamentar_view and painel_votacao_view. That branch will need reconciling with this removal when it's rebased onto 3.1.x.
Descrição
Issue Relacionada
Motivação e Contexto
Como Isso Foi Testado?
Capturas de Tela (se apropriado):
Tipos de Mudanças
Checklist: