explain.depesz.com

PostgreSQL's explain analyze made readable

Result: iAqd

Settings
# exclusive inclusive rows x rows loops node
1. 1.305 1,284.583 ↓ 580.0 580 1

Nested Loop Left Join (cost=3.78..402.50 rows=1 width=251) (actual time=73.072..1,284.583 rows=580 loops=1)

2. 1.100 1,282.118 ↓ 580.0 580 1

Nested Loop (cost=3.50..400.30 rows=1 width=223) (actual time=73.053..1,282.118 rows=580 loops=1)

3. 47.903 1,279.858 ↓ 580.0 580 1

Nested Loop (cost=3.35..397.92 rows=1 width=216) (actual time=73.031..1,279.858 rows=580 loops=1)

  • Join Filter: ("Ras.Det.Rota".fk_entregador = "Ras.Det.Rota.Entregador.Usuario".fk_entregador)
4. 70.499 1,154.681 ↓ 38,637.0 38,637 1

Nested Loop (cost=2.94..395.54 rows=1 width=157) (actual time=2.487..1,154.681 rows=38,637 loops=1)

5. 70.841 1,006.908 ↓ 38,637.0 38,637 1

Nested Loop (cost=2.54..393.20 rows=1 width=124) (actual time=2.474..1,006.908 rows=38,637 loops=1)

6. 92.242 858.793 ↓ 38,637.0 38,637 1

Nested Loop (cost=2.12..390.55 rows=1 width=73) (actual time=2.462..858.793 rows=38,637 loops=1)

7. 40.351 186.996 ↓ 38,637.0 38,637 1

Nested Loop (cost=1.56..388.05 rows=1 width=60) (actual time=2.432..186.996 rows=38,637 loops=1)

  • Join Filter: ("Ras.Det".codigo = "Ras".fk_detalhamento)
8. 4.895 109.790 ↓ 1,755.0 1,755 1

Nested Loop (cost=0.99..47.17 rows=1 width=48) (actual time=2.418..109.790 rows=1,755 loops=1)

9. 99.630 99.630 ↓ 1,755.0 1,755 1

Index Scan using idx_rastramento_detalhamento_data_hora_ocorrencia on "RastreamentoDetalhamento" "Ras.Det" (cost=0.57..44.52 rows=1 width=28) (actual time=2.402..99.630 rows=1,755 loops=1)

  • Index Cond: ((data_hora_ocorrencia >= '2020-01-31 00:00:00-03'::timestamp with time zone) AND (data_hora_ocorrencia <= '2020-01-31 23:59:00-03'::timestamp with time zone))
  • Filter: (fk_ocorrencia = ANY ('{9,79}'::integer[]))
  • Rows Removed by Filter: 174743
10. 5.265 5.265 ↑ 1.0 1 1,755

Index Scan using "DetalhamentoRota_fk_rast_rota_idx" on "DetalhamentoRota" "Ras.Det.Rota" (cost=0.42..2.64 rows=1 width=20) (actual time=0.003..0.003 rows=1 loops=1,755)

  • Index Cond: (fk_rast_rota = "Ras.Det".codigo)
11. 36.855 36.855 ↑ 89.0 22 1,755

Index Scan using "Rastreamento_fk_detalhamento_idx" on "Rastreamento" "Ras" (cost=0.57..316.39 rows=1,959 width=28) (actual time=0.004..0.021 rows=22 loops=1,755)

  • Index Cond: (fk_detalhamento = "Ras.Det.Rota".fk_rast_rota)
12. 579.555 579.555 ↑ 1.0 1 38,637

Index Scan using "Remessa_pkey" on "Remessa" (cost=0.56..2.50 rows=1 width=13) (actual time=0.015..0.015 rows=1 loops=38,637)

  • Index Cond: ((codigo)::text = ("Ras".fk_remessa)::text)
13. 77.274 77.274 ↑ 1.0 1 38,637

Index Scan using "Usuario_pkey" on "Usuario" "Ras.Det.ResponsavelLancamento" (cost=0.41..2.64 rows=1 width=55) (actual time=0.002..0.002 rows=1 loops=38,637)

  • Index Cond: (codigo = "Ras.Det".fk_usuario)
  • Filter: (codigo <> 10)
14. 77.274 77.274 ↑ 1.0 1 38,637

Index Scan using "Entregador_pkey" on "Entregador" "Ras.Det.Rota.Entregador" (cost=0.41..2.34 rows=1 width=33) (actual time=0.002..0.002 rows=1 loops=38,637)

  • Index Cond: (codigo = "Ras.Det.Rota".fk_entregador)
15. 77.274 77.274 ↓ 0.0 0 38,637

Index Scan using "Usuaurio_fk_entregador_key" on "Usuario" "Ras.Det.Rota.Entregador.Usuario" (cost=0.41..2.37 rows=1 width=63) (actual time=0.002..0.002 rows=0 loops=38,637)

  • Index Cond: (fk_entregador = "Ras.Det.Rota.Entregador".codigo)
  • Filter: (fk_courier = 208)
  • Rows Removed by Filter: 1
16. 1.160 1.160 ↑ 1.0 1 580

Index Scan using "Courier_pkey" on "Courier" "Ras.Det.Rota.Entregador.Usuario.Courier" (cost=0.15..2.37 rows=1 width=11) (actual time=0.001..0.002 rows=1 loops=580)

  • Index Cond: (codigo = 208)
17. 1.160 1.160 ↑ 1.0 1 580

Index Scan using "Colaborador_pkey" on "Colaborador" "Ras.Det.Rota.Entregador.Usuario.Colaborador" (cost=0.28..2.20 rows=1 width=28) (actual time=0.002..0.002 rows=1 loops=580)

  • Index Cond: ("Ras.Det.Rota.Entregador.Usuario".fk_colaborador = codigo)