explain.depesz.com

PostgreSQL's explain analyze made readable

Result: i55X : Optimization for: plan #wneK

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.793 98.925 ↓ 777.0 777 1

Nested Loop Left Join (cost=10,396.81..48,646.60 rows=1 width=251) (actual time=61.942..98.925 rows=777 loops=1)

2. 0.713 96.578 ↓ 777.0 777 1

Nested Loop (cost=10,396.53..48,640.91 rows=1 width=223) (actual time=61.932..96.578 rows=777 loops=1)

3. 0.798 95.088 ↓ 777.0 777 1

Nested Loop (cost=10,396.39..48,632.74 rows=1 width=216) (actual time=61.926..95.088 rows=777 loops=1)

4. 0.710 92.736 ↓ 777.0 777 1

Nested Loop (cost=10,395.98..48,627.43 rows=1 width=187) (actual time=61.917..92.736 rows=777 loops=1)

5. 0.620 90.472 ↓ 777.0 777 1

Nested Loop (cost=10,395.57..48,620.44 rows=1 width=136) (actual time=61.908..90.472 rows=777 loops=1)

6. 0.000 78.974 ↓ 777.0 777 1

Nested Loop (cost=10,395.01..48,614.91 rows=1 width=123) (actual time=61.884..78.974 rows=777 loops=1)

  • Join Filter: ("Ras.Det".codigo = "Ras".fk_detalhamento)
7. 14.519 103.444 ↓ 21.0 21 1

Gather (cost=10,394.44..47,803.92 rows=1 width=111) (actual time=61.871..103.444 rows=21 loops=1)

  • Workers Planned: 3
  • Workers Launched: 3
8. 1.107 88.925 ↓ 5.0 5 4 / 4

Nested Loop (cost=9,394.44..46,803.82 rows=1 width=111) (actual time=57.297..88.925 rows=5 loops=4)

9. 26.727 62.952 ↓ 1.0 3,552 4 / 4

Hash Join (cost=9,393.88..25,547.18 rows=3,411 width=83) (actual time=14.743..62.952 rows=3,552 loops=4)

  • Hash Cond: ("Ras.Det.Rota".fk_entregador = "Ras.Det.Rota.Entregador.Usuario".fk_entregador)
10. 21.613 21.613 ↑ 1.3 185,025 4 / 4

Parallel Seq Scan on "DetalhamentoRota" "Ras.Det.Rota" (cost=0.00..15,526.20 rows=238,720 width=20) (actual time=0.016..21.613 rows=185,025 loops=4)

11. 0.054 14.612 ↑ 1.6 52 4 / 4

Hash (cost=9,392.86..9,392.86 rows=81 width=63) (actual time=14.612..14.612 rows=52 loops=4)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
12. 14.558 14.558 ↑ 1.0 81 4 / 4

Seq Scan on "Usuario" "Ras.Det.Rota.Entregador.Usuario" (cost=0.00..9,392.86 rows=81 width=63) (actual time=0.142..14.558 rows=81 loops=4)

  • Filter: (fk_courier = 53)
  • Rows Removed by Filter: 5588
13. 24.866 24.866 ↓ 0.0 0 14,209 / 4

Index Scan using "RastreamentoDetalhamento_pkey" on "RastreamentoDetalhamento" "Ras.Det" (cost=0.57..6.23 rows=1 width=28) (actual time=0.007..0.007 rows=0 loops=14,209)

  • Index Cond: (codigo = "Ras.Det.Rota".fk_rast_rota)
  • Filter: ((data_hora_ocorrencia >= '2020-01-22 00:00:00-03'::timestamp with time zone) AND (data_hora_ocorrencia <= '2020-01-22 23:59:00-03'::timestamp with time zone) AND (fk_ocorrencia = ANY ('{9,79}'::integer[])))
  • Rows Removed by Filter: 1
14. 0.441 0.441 ↑ 52.9 37 21

Index Scan using "Rastreamento_fk_detalhamento_idx" on "Rastreamento" "Ras" (cost=0.57..786.50 rows=1,959 width=28) (actual time=0.007..0.021 rows=37 loops=21)

  • Index Cond: (fk_detalhamento = "Ras.Det.Rota".fk_rast_rota)
15. 10.878 10.878 ↑ 1.0 1 777

Index Scan using "Remessa_pkey" on "Remessa" (cost=0.56..5.53 rows=1 width=13) (actual time=0.014..0.014 rows=1 loops=777)

  • Index Cond: ((codigo)::text = ("Ras".fk_remessa)::text)
  • Filter: (data_cadastro >= '2019-12-08 00:00:00-03'::timestamp with time zone)
16. 1.554 1.554 ↑ 1.0 1 777

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

  • Index Cond: (codigo = "Ras.Det".fk_usuario)
  • Filter: (codigo <> 10)
17. 1.554 1.554 ↑ 1.0 1 777

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

  • Index Cond: (codigo = "Ras.Det.Rota".fk_entregador)
18. 0.777 0.777 ↑ 1.0 1 777

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

  • Index Cond: (codigo = 53)
19. 1.554 1.554 ↑ 1.0 1 777

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

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