explain.depesz.com

PostgreSQL's explain analyze made readable

Result: SYmA

Settings
# exclusive inclusive rows x rows loops node
1. 1.362 1,314.932 ↓ 580.0 580 1

Nested Loop Left Join (cost=3.78..402.51 rows=1 width=251) (actual time=72.523..1,314.932 rows=580 loops=1)

  • Join Filter: (("Remessa".data_cadastro >= '2019-12-31 00:00:00-03'::timestamp with time zone) AND ("Remessa".data_cadastro <= '2020-01-31 23:59:00-03'::timestamp with time zone))
2. 1.161 1,312.410 ↓ 580.0 580 1

Nested Loop (cost=3.50..400.30 rows=1 width=231) (actual time=72.506..1,312.410 rows=580 loops=1)

3. 51.714 1,310.089 ↓ 580.0 580 1

Nested Loop (cost=3.35..397.92 rows=1 width=224) (actual time=72.475..1,310.089 rows=580 loops=1)

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

Nested Loop (cost=2.94..395.54 rows=1 width=165) (actual time=2.384..1,181.101 rows=38,637 loops=1)

5. 74.598 1,028.425 ↓ 38,637.0 38,637 1

Nested Loop (cost=2.54..393.20 rows=1 width=132) (actual time=2.372..1,028.425 rows=38,637 loops=1)

6. 109.556 876.553 ↓ 38,637.0 38,637 1

Nested Loop (cost=2.12..390.55 rows=1 width=81) (actual time=2.360..876.553 rows=38,637 loops=1)

7. 40.076 187.442 ↓ 38,637.0 38,637 1

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

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

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

9. 98.388 98.388 ↓ 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.294..98.388 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. 7.020 7.020 ↑ 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.004 rows=1 loops=1,755)

  • Index Cond: (fk_rast_rota = "Ras.Det".codigo)
11. 38.610 38.610 ↑ 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.022 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=21) (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)