explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wjEF : Optimization for: plan #D2bW

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.076 354.243 ↑ 1.0 500 1

Limit (cost=1.99..3,998.78 rows=500 width=4,398) (actual time=330.283..354.243 rows=500 loops=1)

2. 0.192 354.167 ↑ 66.4 500 1

Nested Loop Left Join (cost=1.99..265,317.34 rows=33,191 width=4,398) (actual time=330.282..354.167 rows=500 loops=1)

3. 0.258 352.975 ↑ 66.4 500 1

Nested Loop (cost=1.71..255,438.36 rows=33,191 width=4,391) (actual time=330.273..352.975 rows=500 loops=1)

4. 0.381 352.217 ↑ 66.4 500 1

Nested Loop Left Join (cost=1.56..249,912.14 rows=33,191 width=4,346) (actual time=330.267..352.217 rows=500 loops=1)

5. 0.562 351.836 ↑ 66.4 500 1

Nested Loop (cost=1.42..244,383.67 rows=33,191 width=4,301) (actual time=330.263..351.836 rows=500 loops=1)

6. 0.315 350.774 ↑ 66.4 500 1

Nested Loop Left Join (cost=1.27..238,857.45 rows=33,191 width=4,256) (actual time=330.242..350.774 rows=500 loops=1)

  • Join Filter: ("Servico".fk_servico_correio = "Servico.ServicoCorreio".codigo)
7. 1.815 350.459 ↑ 66.4 500 1

Nested Loop Left Join (cost=1.27..234,760.25 rows=33,191 width=4,251) (actual time=330.234..350.459 rows=500 loops=1)

  • Join Filter: ("Servico".fk_etiqueta_termica_economica = "Servico.EtiquetaTermicaRemessaEconomica".codigo)
  • Rows Removed by Join Filter: 27,500
8. 1.814 347.144 ↑ 66.4 500 1

Nested Loop Left Join (cost=1.27..205,405.14 rows=33,191 width=3,610) (actual time=330.197..347.144 rows=500 loops=1)

  • Join Filter: ("Servico".fk_etiqueta_termica_expressa = "Servico.EtiquetaTermicaRemessaExpressa".codigo)
  • Rows Removed by Join Filter: 28,000
9. 1.841 343.830 ↑ 66.4 500 1

Nested Loop Left Join (cost=1.27..176,055.17 rows=33,191 width=2,969) (actual time=330.158..343.830 rows=500 loops=1)

  • Join Filter: ("Servico".fk_etiqueta_termica_correios_ar = "Servico.EtiquetaTermicaCorreiosAR".codigo)
  • Rows Removed by Join Filter: 29,500
10. 0.290 340.489 ↑ 66.4 500 1

Nested Loop (cost=1.27..146,742.84 rows=33,191 width=2,328) (actual time=330.089..340.489 rows=500 loops=1)

11. 0.525 315.199 ↑ 66.4 500 1

Nested Loop Left Join (cost=0.98..135,894.68 rows=33,191 width=2,316) (actual time=311.303..315.199 rows=500 loops=1)

12. 0.551 1.174 ↑ 66.4 500 1

Nested Loop (cost=0.56..67,617.71 rows=33,191 width=2,273) (actual time=0.129..1.174 rows=500 loops=1)

13. 0.003 0.097 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.00..168.74 rows=1 width=1,409) (actual time=0.097..0.097 rows=1 loops=1)

  • Join Filter: ("Servico".fk_etiqueta_termica_correios = "Servico.EtiquetaTermicaCorreios".codigo)
  • Rows Removed by Join Filter: 44
14. 0.005 0.090 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.00..161.41 rows=1 width=768) (actual time=0.090..0.090 rows=1 loops=1)

  • Join Filter: ("Servico".fk_etiqueta_termica = "Servico.EtiquetaTermica".codigo)
  • Rows Removed by Join Filter: 45
15. 0.003 0.079 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.00..154.08 rows=1 width=127) (actual time=0.078..0.079 rows=1 loops=1)

  • Join Filter: ("Servico".fk_protocolo_recebimento = "Servico.ProtocoloRecebimento".codigo)
  • Rows Removed by Join Filter: 13
16. 0.008 0.074 ↑ 1.0 1 1

Nested Loop (cost=0.00..146.75 rows=1 width=95) (actual time=0.073..0.074 rows=1 loops=1)

  • Join Filter: ("Servico".fk_cliente = "Servico.Cliente".codigo)
  • Rows Removed by Join Filter: 20
17. 0.061 0.061 ↑ 1.0 1 1

Seq Scan on "Servico" (cost=0.00..143.56 rows=1 width=84) (actual time=0.061..0.061 rows=1 loops=1)

  • Filter: (codigo = 7)
  • Rows Removed by Filter: 175
18. 0.005 0.005 ↑ 2.5 21 1

Seq Scan on "Cliente" "Servico.Cliente" (cost=0.00..2.53 rows=53 width=15) (actual time=0.004..0.005 rows=21 loops=1)

19. 0.002 0.002 ↑ 4.2 14 1

Seq Scan on "TipoEtiquetaFormulario" "Servico.ProtocoloRecebimento" (cost=0.00..6.59 rows=59 width=36) (actual time=0.002..0.002 rows=14 loops=1)

20. 0.006 0.006 ↑ 1.3 46 1

Seq Scan on "TipoEtiquetaFormulario" "Servico.EtiquetaTermica" (cost=0.00..6.59 rows=59 width=645) (actual time=0.000..0.006 rows=46 loops=1)

21. 0.004 0.004 ↑ 1.3 45 1

Seq Scan on "TipoEtiquetaFormulario" "Servico.EtiquetaTermicaCorreios" (cost=0.00..6.59 rows=59 width=645) (actual time=0.000..0.004 rows=45 loops=1)

22. 0.526 0.526 ↑ 66.4 500 1

Index Scan using "Remessa_idx_servico_data_cadastro" on "Remessa" (cost=0.56..67,117.06 rows=33,191 width=868) (actual time=0.029..0.526 rows=500 loops=1)

  • Index Cond: ((data_cadastro >= '2020-01-28 00:00:00.841-03'::timestamp with time zone) AND (data_cadastro <= '2020-01-30 23:59:59.841-03'::timestamp with time zone) AND (fk_servico = 7))
23. 313.500 313.500 ↓ 0.0 0 500

Index Scan using "Coleta_fk_remessa_idx" on "Coleta" (cost=0.42..2.05 rows=1 width=55) (actual time=0.627..0.627 rows=0 loops=500)

  • Index Cond: (("Remessa".codigo)::text = (fk_remessa)::text)
24. 25.000 25.000 ↑ 1.0 1 500

Index Scan using "Localidade_pkey" on "Localidade" (cost=0.29..0.33 rows=1 width=16) (actual time=0.050..0.050 rows=1 loops=500)

  • Index Cond: (codigo = "Remessa".fk_localidade)
25. 1.474 1.500 ↑ 1.0 59 500

Materialize (cost=0.00..6.88 rows=59 width=645) (actual time=0.000..0.003 rows=59 loops=500)

26. 0.026 0.026 ↑ 1.0 59 1

Seq Scan on "TipoEtiquetaFormulario" "Servico.EtiquetaTermicaCorreiosAR" (cost=0.00..6.59 rows=59 width=645) (actual time=0.008..0.026 rows=59 loops=1)

27. 1.490 1.500 ↑ 1.0 57 500

Materialize (cost=0.00..6.88 rows=59 width=645) (actual time=0.000..0.003 rows=57 loops=500)

28. 0.010 0.010 ↑ 1.0 57 1

Seq Scan on "TipoEtiquetaFormulario" "Servico.EtiquetaTermicaRemessaExpressa" (cost=0.00..6.59 rows=59 width=645) (actual time=0.002..0.010 rows=57 loops=1)

29. 1.491 1.500 ↑ 1.1 56 500

Materialize (cost=0.00..6.88 rows=59 width=645) (actual time=0.000..0.003 rows=56 loops=500)

30. 0.009 0.009 ↑ 1.1 56 1

Seq Scan on "TipoEtiquetaFormulario" "Servico.EtiquetaTermicaRemessaEconomica" (cost=0.00..6.59 rows=59 width=645) (actual time=0.001..0.009 rows=56 loops=1)

31. 0.000 0.000 ↑ 9.0 1 500

Materialize (cost=0.00..1.14 rows=9 width=9) (actual time=0.000..0.000 rows=1 loops=500)

32. 0.004 0.004 ↑ 9.0 1 1

Seq Scan on "ServicoCorreio" "Servico.ServicoCorreio" (cost=0.00..1.09 rows=9 width=9) (actual time=0.004..0.004 rows=1 loops=1)

33. 0.500 0.500 ↑ 1.0 1 500

Index Scan using "Courier_pkey" on "Courier" "CourierDestino" (cost=0.15..0.17 rows=1 width=49) (actual time=0.001..0.001 rows=1 loops=500)

  • Index Cond: (codigo = "Remessa".fk_courier_destino)
34. 0.000 0.000 ↓ 0.0 0 500

Index Scan using "Courier_pkey" on "Courier" "CourierColeta" (cost=0.15..0.17 rows=1 width=49) (actual time=0.000..0.000 rows=0 loops=500)

  • Index Cond: ("Remessa".fk_courier_coleta = codigo)
35. 0.500 0.500 ↑ 1.0 1 500

Index Scan using "Courier_pkey" on "Courier" "CourierOrigem" (cost=0.15..0.17 rows=1 width=49) (actual time=0.001..0.001 rows=1 loops=500)

  • Index Cond: (codigo = "Remessa".fk_courier_origem)
36. 1.000 1.000 ↑ 1.0 1 500

Index Scan using "RotaColetaEntrega_pkey" on "RotaColetaEntrega" (cost=0.28..0.30 rows=1 width=11) (actual time=0.002..0.002 rows=1 loops=500)

  • Index Cond: ("Remessa".fk_rota_coleta_entrega = codigo)