explain.depesz.com

PostgreSQL's explain analyze made readable

Result: dUNg

Settings
# exclusive inclusive rows x rows loops node
1. 0.057 167,124.071 ↑ 1.0 6 1

Nested Loop Left Join (cost=5.96..6,947.54 rows=6 width=1,082) (actual time=167,119.755..167,124.071 rows=6 loops=1)

2. 0.337 167,123.738 ↑ 1.0 6 1

Nested Loop Left Join (cost=5.54..6,896.85 rows=6 width=989) (actual time=167,119.677..167,123.738 rows=6 loops=1)

  • Join Filter: ("Remessa".fk_courier_destino = "CourierDestino".codigo)
  • Rows Removed by Join Filter: 888
3. 0.625 167,123.005 ↑ 1.0 6 1

Nested Loop Left Join (cost=5.54..6,857.97 rows=6 width=982) (actual time=167,119.382..167,123.005 rows=6 loops=1)

  • Join Filter: ("Remessa".fk_courier_coleta = "CourierColeta".codigo)
  • Rows Removed by Join Filter: 1632
4. 0.053 167,121.576 ↑ 1.0 6 1

Nested Loop Left Join (cost=5.54..6,819.09 rows=6 width=933) (actual time=167,118.800..167,121.576 rows=6 loops=1)

  • Join Filter: ("UltimaOcorrenciaRastreamento".fk_situacao_remessa = "UltimaOcorrenciaRastreamento.SituacaoRemessa".codigo)
  • Rows Removed by Join Filter: 96
5. 0.184 167,121.475 ↑ 1.0 6 1

Nested Loop Left Join (cost=5.54..6,814.61 rows=6 width=916) (actual time=167,118.766..167,121.475 rows=6 loops=1)

  • Join Filter: ("Remessa".fk_ultima_ocorrencia_rastreamento = "UltimaOcorrenciaRastreamento".codigo)
  • Rows Removed by Join Filter: 462
6. 0.059 167,121.093 ↑ 1.0 6 1

Nested Loop Left Join (cost=5.54..6,797.77 rows=6 width=879) (actual time=167,118.636..167,121.093 rows=6 loops=1)

  • Join Filter: ("Remessa".fk_parentesco_final = "ParentescoFinal".codigo)
  • Rows Removed by Join Filter: 100
7. 0.289 167,120.980 ↑ 1.0 6 1

Nested Loop Left Join (cost=5.54..6,793.90 rows=6 width=870) (actual time=167,118.603..167,120.980 rows=6 loops=1)

  • Join Filter: ("Remessa".fk_ocorrencia_devolucao = "Devolucao".codigo)
  • Rows Removed by Join Filter: 810
8. 0.077 167,120.361 ↑ 1.0 6 1

Nested Loop Left Join (cost=5.54..6,777.06 rows=6 width=837) (actual time=167,118.390..167,120.361 rows=6 loops=1)

9. 0.284 167,119.954 ↑ 1.0 6 1

Nested Loop Left Join (cost=1.13..6,726.51 rows=6 width=812) (actual time=167,118.328..167,119.954 rows=6 loops=1)

  • Join Filter: ("Remessa".fk_ultimo_motivo_tratativa = "UltimoMotivoTrativa".codigo)
  • Rows Removed by Join Filter: 810
10. 0.274 167,119.388 ↑ 1.0 6 1

Nested Loop Left Join (cost=1.13..6,709.67 rows=6 width=779) (actual time=167,118.165..167,119.388 rows=6 loops=1)

  • Join Filter: ("Remessa".fk_tratativa = "SituacaoTratativa".codigo)
  • Rows Removed by Join Filter: 810
11. 0.028 167,118.814 ↑ 1.0 6 1

Nested Loop Left Join (cost=1.13..6,692.83 rows=6 width=746) (actual time=167,117.976..167,118.814 rows=6 loops=1)

12. 0.021 167,118.762 ↑ 1.0 6 1

Limit (cost=0.85..6,646.98 rows=6 width=720) (actual time=167,117.955..167,118.762 rows=6 loops=1)

13. 0.025 167,118.741 ↑ 417.0 6 1

Nested Loop (cost=0.85..2,771,439.02 rows=2,502 width=720) (actual time=167,117.953..167,118.741 rows=6 loops=1)

  • Join Filter: ("Servico".fk_cliente = "Servico.Cliente".codigo)
  • Rows Removed by Join Filter: 6
14. 0.376 167,118.698 ↑ 417.0 6 1

Nested Loop (cost=0.85..2,769,483.25 rows=2,502 width=677) (actual time=167,117.935..167,118.698 rows=6 loops=1)

  • Join Filter: ("Remessa".fk_servico = "Servico".codigo)
  • Rows Removed by Join Filter: 942
15. 0.019 167,117.740 ↑ 417.0 6 1

Nested Loop (cost=0.85..2,761,682.58 rows=2,502 width=652) (actual time=167,117.493..167,117.740 rows=6 loops=1)

  • Join Filter: ("Remessa".fk_prioridade = "PrioridadeRemessa".codigo)
16. 0.026 167,117.703 ↑ 417.0 6 1

Nested Loop (cost=0.85..2,761,619.00 rows=2,502 width=642) (actual time=167,117.477..167,117.703 rows=6 loops=1)

  • Join Filter: ("Localidade".fk_classificacao_localidade = "Localidade.ClassificacaoLocalidade".codigo)
  • Rows Removed by Join Filter: 4
17. 0.049 167,117.659 ↑ 417.0 6 1

Nested Loop (cost=0.85..2,761,524.14 rows=2,502 width=632) (actual time=167,117.461..167,117.659 rows=6 loops=1)

18. 0.031 167,117.520 ↑ 417.0 6 1

Nested Loop (cost=0.56..2,759,959.28 rows=2,502 width=616) (actual time=167,117.422..167,117.520 rows=6 loops=1)

  • Join Filter: ("Remessa".fk_tipo_remessa = "TipoRemessa".codigo)
19. 167,117.447 167,117.447 ↑ 417.0 6 1

Index Scan Backward using "Remessa_pkey" on "Remessa" (cost=0.56..2,759,795.57 rows=2,502 width=609) (actual time=167,117.376..167,117.447 rows=6 loops=1)

  • Filter: ((data_cadastro >= '2020-01-28 00:00:00-03'::timestamp with time zone) AND (data_cadastro <= '2020-01-29 23:59:00-03'::timestamp with time zone) AND (fk_cliente = 2))
  • Rows Removed by Filter: 1113396
20. 0.029 0.042 ↑ 5.0 1 6

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

21. 0.013 0.013 ↑ 5.0 1 1

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

22. 0.090 0.090 ↑ 1.0 1 6

Index Scan using "Localidade_pkey" on "Localidade" (cost=0.29..0.63 rows=1 width=20) (actual time=0.015..0.015 rows=1 loops=6)

  • Index Cond: (codigo = "Remessa".fk_localidade)
23. 0.010 0.018 ↑ 1.5 2 6

Materialize (cost=0.00..1.04 rows=3 width=14) (actual time=0.002..0.003 rows=2 loops=6)

24. 0.008 0.008 ↑ 1.0 3 1

Seq Scan on "ClassificacaoLocalidade" "Localidade.ClassificacaoLocalidade" (cost=0.00..1.03 rows=3 width=14) (actual time=0.006..0.008 rows=3 loops=1)

25. 0.013 0.018 ↑ 2.0 1 6

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

26. 0.005 0.005 ↑ 2.0 1 1

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

27. 0.285 0.582 ↑ 1.3 158 6

Materialize (cost=0.00..144.08 rows=205 width=29) (actual time=0.005..0.097 rows=158 loops=6)

28. 0.297 0.297 ↑ 1.3 158 1

Seq Scan on "Servico" (cost=0.00..143.05 rows=205 width=29) (actual time=0.009..0.297 rows=158 loops=1)

29. 0.011 0.018 ↑ 26.5 2 6

Materialize (cost=0.00..2.80 rows=53 width=39) (actual time=0.002..0.003 rows=2 loops=6)

30. 0.007 0.007 ↑ 26.5 2 1

Seq Scan on "Cliente" "Servico.Cliente" (cost=0.00..2.53 rows=53 width=39) (actual time=0.006..0.007 rows=2 loops=1)

31. 0.024 0.024 ↓ 0.0 0 6

Index Scan using "CentroCustoCliente_pkey" on "CentroCustoCliente" (cost=0.28..7.63 rows=1 width=30) (actual time=0.003..0.004 rows=0 loops=6)

  • Index Cond: ("Remessa".fk_centro_custo = codigo)
32. 0.225 0.300 ↑ 1.0 135 6

Materialize (cost=0.00..5.02 rows=135 width=37) (actual time=0.002..0.050 rows=135 loops=6)

33. 0.075 0.075 ↑ 1.0 135 1

Seq Scan on "Ocorrencia" "SituacaoTratativa" (cost=0.00..4.35 rows=135 width=37) (actual time=0.008..0.075 rows=135 loops=1)

34. 0.231 0.282 ↑ 1.0 135 6

Materialize (cost=0.00..5.02 rows=135 width=37) (actual time=0.003..0.047 rows=135 loops=6)

35. 0.051 0.051 ↑ 1.0 135 1

Seq Scan on "Ocorrencia" "UltimoMotivoTrativa" (cost=0.00..4.35 rows=135 width=37) (actual time=0.005..0.051 rows=135 loops=1)

36. 0.114 0.330 ↑ 1.0 1 6

Bitmap Heap Scan on "Entregador" (cost=4.41..8.43 rows=1 width=29) (actual time=0.055..0.055 rows=1 loops=6)

  • Recheck Cond: ("Remessa".entregador_final = codigo)
  • Heap Blocks: exact=6
37. 0.216 0.216 ↑ 1.0 1 6

Bitmap Index Scan on "Entregador_pkey" (cost=0.00..4.41 rows=1 width=0) (actual time=0.036..0.036 rows=1 loops=6)

  • Index Cond: ("Remessa".entregador_final = codigo)
38. 0.269 0.330 ↑ 1.0 135 6

Materialize (cost=0.00..5.02 rows=135 width=37) (actual time=0.003..0.055 rows=135 loops=6)

39. 0.061 0.061 ↑ 1.0 135 1

Seq Scan on "Ocorrencia" "Devolucao" (cost=0.00..4.35 rows=135 width=37) (actual time=0.006..0.061 rows=135 loops=1)

40. 0.037 0.054 ↑ 1.6 18 6

Materialize (cost=0.00..1.42 rows=28 width=13) (actual time=0.002..0.009 rows=18 loops=6)

41. 0.017 0.017 ↑ 1.3 21 1

Seq Scan on "GrauRelacionamento" "ParentescoFinal" (cost=0.00..1.28 rows=28 width=13) (actual time=0.007..0.017 rows=21 loops=1)

42. 0.141 0.198 ↑ 1.7 78 6

Materialize (cost=0.00..5.02 rows=135 width=41) (actual time=0.003..0.033 rows=78 loops=6)

43. 0.057 0.057 ↑ 1.7 78 1

Seq Scan on "Ocorrencia" "UltimaOcorrenciaRastreamento" (cost=0.00..4.35 rows=135 width=41) (actual time=0.005..0.057 rows=78 loops=1)

44. 0.037 0.048 ↑ 2.0 17 6

Materialize (cost=0.00..1.51 rows=34 width=21) (actual time=0.003..0.008 rows=17 loops=6)

45. 0.011 0.011 ↑ 2.0 17 1

Seq Scan on "SituacaoRemessa" "UltimaOcorrenciaRastreamento.SituacaoRemessa" (cost=0.00..1.34 rows=34 width=21) (actual time=0.005..0.011 rows=17 loops=1)

46. 0.558 0.804 ↑ 1.0 272 6

Materialize (cost=0.00..15.08 rows=272 width=49) (actual time=0.003..0.134 rows=272 loops=6)

47. 0.246 0.246 ↑ 1.0 272 1

Seq Scan on "Courier" "CourierColeta" (cost=0.00..13.72 rows=272 width=49) (actual time=0.007..0.246 rows=272 loops=1)

48. 0.290 0.396 ↑ 1.8 149 6

Materialize (cost=0.00..15.08 rows=272 width=11) (actual time=0.005..0.066 rows=149 loops=6)

49. 0.106 0.106 ↑ 1.8 149 1

Seq Scan on "Courier" "CourierDestino" (cost=0.00..13.72 rows=272 width=11) (actual time=0.008..0.106 rows=149 loops=1)

50. 0.276 0.276 ↓ 0.0 0 6

Index Scan using "Coleta_fk_remessa_idx" on "Coleta" (cost=0.42..8.44 rows=1 width=105) (actual time=0.046..0.046 rows=0 loops=6)

  • Index Cond: (("Remessa".codigo)::text = (fk_remessa)::text)