explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1M0f

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 0.307 ↑ 2.0 1 1

Limit (cost=99.86..99.86 rows=2 width=1,898) (actual time=0.306..0.307 rows=1 loops=1)

2. 0.015 0.306 ↑ 2.0 1 1

Sort (cost=99.86..99.86 rows=2 width=1,898) (actual time=0.305..0.306 rows=1 loops=1)

  • Sort Key: "Remessa".data_ultima_ocorrencia DESC
  • Sort Method: quicksort Memory: 26kB
3. 0.001 0.291 ↑ 2.0 1 1

Nested Loop Left Join (cost=30.77..99.85 rows=2 width=1,898) (actual time=0.261..0.291 rows=1 loops=1)

4. 0.001 0.284 ↑ 2.0 1 1

Nested Loop Left Join (cost=30.64..99.38 rows=2 width=1,891) (actual time=0.254..0.284 rows=1 loops=1)

5. 0.001 0.277 ↑ 2.0 1 1

Nested Loop Left Join (cost=30.51..98.91 rows=2 width=1,886) (actual time=0.247..0.277 rows=1 loops=1)

  • Join Filter: ("Remessa".fk_tipo_remessa = "TipoRemessa".codigo)
6. 0.001 0.266 ↑ 2.0 1 1

Nested Loop Left Join (cost=30.51..97.70 rows=2 width=1,879) (actual time=0.236..0.266 rows=1 loops=1)

7. 0.001 0.260 ↑ 2.0 1 1

Nested Loop Left Join (cost=30.37..97.19 rows=2 width=1,862) (actual time=0.231..0.260 rows=1 loops=1)

8. 0.002 0.245 ↑ 2.0 1 1

Nested Loop Left Join (cost=30.08..80.14 rows=2 width=1,796) (actual time=0.216..0.245 rows=1 loops=1)

  • Join Filter: ("Remessa".fk_prioridade = "PrioridadeRemessa".codigo)
9. 0.001 0.237 ↑ 2.0 1 1

Nested Loop Left Join (cost=30.08..79.06 rows=2 width=1,786) (actual time=0.209..0.237 rows=1 loops=1)

10. 0.001 0.231 ↑ 2.0 1 1

Nested Loop Left Join (cost=29.81..62.46 rows=2 width=1,779) (actual time=0.203..0.231 rows=1 loops=1)

11. 0.002 0.221 ↑ 2.0 1 1

Nested Loop Left Join (cost=29.53..57.71 rows=2 width=1,721) (actual time=0.193..0.221 rows=1 loops=1)

12. 0.038 0.215 ↑ 2.0 1 1

Hash Right Join (cost=29.24..41.10 rows=2 width=1,685) (actual time=0.187..0.215 rows=1 loops=1)

  • Hash Cond: ("CourierDestino".codigo = "Remessa".fk_courier_destino)
13. 0.023 0.023 ↑ 1.0 256 1

Seq Scan on "Courier" "CourierDestino" (cost=0.00..10.56 rows=256 width=53) (actual time=0.001..0.023 rows=256 loops=1)

14. 0.006 0.154 ↑ 2.0 1 1

Hash (cost=29.21..29.21 rows=2 width=1,636) (actual time=0.154..0.154 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
15. 0.036 0.148 ↑ 2.0 1 1

Hash Right Join (cost=17.36..29.21 rows=2 width=1,636) (actual time=0.146..0.148 rows=1 loops=1)

  • Hash Cond: ("CourierColeta".codigo = "Remessa".fk_courier_coleta)
16. 0.031 0.031 ↑ 1.0 256 1

Seq Scan on "Courier" "CourierColeta" (cost=0.00..10.56 rows=256 width=49) (actual time=0.003..0.031 rows=256 loops=1)

17. 0.004 0.081 ↑ 2.0 1 1

Hash (cost=17.34..17.34 rows=2 width=1,591) (actual time=0.081..0.081 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
18. 0.026 0.077 ↑ 2.0 1 1

Hash Right Join (cost=12.41..17.34 rows=2 width=1,591) (actual time=0.065..0.077 rows=1 loops=1)

  • Hash Cond: ("UltimaOcorrenciaRastreamento".codigo = "Remessa".fk_ultima_ocorrencia_rastreamento)
19. 0.019 0.019 ↑ 1.0 127 1

Seq Scan on "Ocorrencia" "UltimaOcorrenciaRastreamento" (cost=0.00..4.27 rows=127 width=40) (actual time=0.007..0.019 rows=127 loops=1)

20. 0.006 0.032 ↑ 2.0 1 1

Hash (cost=12.39..12.39 rows=2 width=1,551) (actual time=0.032..0.032 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
21. 0.026 0.026 ↑ 2.0 1 1

Index Scan using idx_numero_postagem on "Remessa" (cost=0.56..12.39 rows=2 width=1,551) (actual time=0.025..0.026 rows=1 loops=1)

  • Index Cond: ((numero_postagem)::text = 'BJ148201199BR'::text)
22. 0.004 0.004 ↓ 0.0 0 1

Index Scan using "ArquivoProcessado_pkey" on "ArquivoProcessado" (cost=0.29..8.31 rows=1 width=40) (actual time=0.004..0.004 rows=0 loops=1)

  • Index Cond: ("Remessa".fk_arquivo_processado = codigo)
23. 0.009 0.009 ↑ 1.0 1 1

Index Scan using "Fornecedor_pkey" on "Fornecedor" "CourierDestino.Fornecedor" (cost=0.28..2.38 rows=1 width=62) (actual time=0.009..0.009 rows=1 loops=1)

  • Index Cond: ("CourierDestino".fk_fornecedor = codigo)
24. 0.005 0.005 ↓ 0.0 0 1

Index Scan using "RotaColetaEntrega_pkey" on "RotaColetaEntrega" (cost=0.28..8.29 rows=1 width=11) (actual time=0.004..0.005 rows=0 loops=1)

  • Index Cond: ("Remessa".fk_rota_coleta_entrega = codigo)
25. 0.003 0.006 ↑ 2.0 1 1

Materialize (cost=0.00..1.03 rows=2 width=14) (actual time=0.006..0.006 rows=1 loops=1)

26. 0.003 0.003 ↑ 2.0 1 1

Seq Scan on "PrioridadeRemessa" (cost=0.00..1.02 rows=2 width=14) (actual time=0.003..0.003 rows=1 loops=1)

27. 0.002 0.014 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.29..8.51 rows=1 width=70) (actual time=0.013..0.014 rows=1 loops=1)

28. 0.006 0.006 ↑ 1.0 1 1

Index Scan using "Servico_pkey" on "Servico" (cost=0.14..8.16 rows=1 width=38) (actual time=0.005..0.006 rows=1 loops=1)

  • Index Cond: ("Remessa".fk_servico = codigo)
29. 0.006 0.006 ↑ 1.0 1 1

Index Scan using "TipoEtiquetaFormulario_pkey" on "TipoEtiquetaFormulario" "Servico.EtiquetaTermica" (cost=0.14..0.34 rows=1 width=36) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: ("Servico".fk_etiqueta_termica = codigo)
30. 0.005 0.005 ↑ 1.0 1 1

Index Scan using "SituacaoRemessa_pkey" on "SituacaoRemessa" "UltimaOcorrenciaRastreamento.SituacaoRemessa" (cost=0.14..0.25 rows=1 width=21) (actual time=0.004..0.005 rows=1 loops=1)

  • Index Cond: ("UltimaOcorrenciaRastreamento".fk_situacao_remessa = codigo)
31. 0.008 0.010 ↑ 5.0 1 1

Materialize (cost=0.00..1.07 rows=5 width=11) (actual time=0.010..0.010 rows=1 loops=1)

32. 0.002 0.002 ↑ 5.0 1 1

Seq Scan on "TipoRemessa" (cost=0.00..1.05 rows=5 width=11) (actual time=0.002..0.002 rows=1 loops=1)

33. 0.006 0.006 ↑ 1.0 1 1

Index Scan using "Negocio_pkey" on "Negocio" "Servico.Negocio" (cost=0.13..0.22 rows=1 width=9) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: ("Servico".fk_negocio = codigo)
34. 0.006 0.006 ↑ 1.0 1 1

Index Scan using "TipoRemessa_pkey" on "TipoRemessa" "Servico.TipoRemessa" (cost=0.13..0.22 rows=1 width=11) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: ("Servico".fk_tipo_de_remessa = codigo)
Planning time : 9.043 ms