explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sGxP

Settings
# exclusive inclusive rows x rows loops node
1. 0.369 103.872 ↓ 812.0 812 1

Nested Loop Left Join (cost=10,396.81..48,647.49 rows=1 width=251) (actual time=65.904..103.872 rows=812 loops=1)

2. 0.145 101.067 ↓ 812.0 812 1

Nested Loop (cost=10,396.53..48,641.80 rows=1 width=223) (actual time=65.887..101.067 rows=812 loops=1)

3. 1.204 99.298 ↓ 812.0 812 1

Nested Loop (cost=10,396.39..48,633.63 rows=1 width=216) (actual time=65.877..99.298 rows=812 loops=1)

4. 1.084 96.470 ↓ 812.0 812 1

Nested Loop (cost=10,395.98..48,628.33 rows=1 width=187) (actual time=65.860..96.470 rows=812 loops=1)

5. 0.956 93.762 ↓ 812.0 812 1

Nested Loop (cost=10,395.57..48,620.49 rows=1 width=136) (actual time=65.844..93.762 rows=812 loops=1)

6. 0.000 79.798 ↓ 813.0 813 1

Nested Loop (cost=10,395.01..48,614.96 rows=1 width=123) (actual time=65.803..79.798 rows=813 loops=1)

  • Join Filter: ("Ras.Det".codigo = "Ras".fk_detalhamento)
7. 10.271 104.334 ↓ 22.0 22 1

Gather (cost=10,394.44..47,803.97 rows=1 width=111) (actual time=65.777..104.334 rows=22 loops=1)

  • Workers Planned: 3
  • Workers Launched: 3
8. 0.275 94.063 ↓ 6.0 6 4 / 4

Nested Loop (cost=9,394.44..46,803.87 rows=1 width=111) (actual time=62.144..94.063 rows=6 loops=4)

9. 27.899 65.370 ↓ 1.0 3,552 4 / 4

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

  • Hash Cond: ("Ras.Det.Rota".fk_entregador = "Ras.Det.Rota.Entregador.Usuario".fk_entregador)
10. 24.196 24.196 ↑ 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.012..24.196 rows=185,025 loops=4)

11. 0.046 13.275 ↑ 1.6 52 4 / 4

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 13kB
12. 13.229 13.229 ↑ 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.116..13.229 rows=81 loops=4)

  • Filter: (fk_courier = 53)
  • Rows Removed by Filter: 5,588
13. 28.418 28.418 ↓ 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.008..0.008 rows=0 loops=14,209)

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

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

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

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

  • Index Cond: ((codigo)::text = ("Ras".fk_remessa)::text)
  • Filter: (data_cadastro >= '2019-12-15 00:00:00-03'::timestamp with time zone)
  • Rows Removed by Filter: 0
16. 1.624 1.624 ↑ 1.0 1 812

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

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

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=812)

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

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.002 rows=1 loops=812)

  • Index Cond: (codigo = 53)
19. 2.436 2.436 ↑ 1.0 1 812

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.003..0.003 rows=1 loops=812)

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