explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lMY3

Settings
# exclusive inclusive rows x rows loops node
1. 0.410 106.414 ↓ 812.0 812 1

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

2. 0.148 103.568 ↓ 812.0 812 1

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

3. 1.215 101.796 ↓ 812.0 812 1

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

4. 1.110 98.957 ↓ 812.0 812 1

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

5. 1.051 96.223 ↓ 812.0 812 1

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

6. 0.000 82.164 ↓ 813.0 813 1

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

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

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

  • Workers Planned: 3
  • Workers Launched: 3
8. 0.632 96.956 ↓ 6.0 6 4 / 4

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

9. 27.273 67.906 ↓ 1.0 3,552 4 / 4

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

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

11. 0.036 16.460 ↑ 1.6 52 4 / 4

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

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
12. 16.424 16.424 ↑ 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.117..16.424 rows=81 loops=4)

  • Filter: (fk_courier = 53)
  • Rows Removed by Filter: 5588
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.418 0.418 ↑ 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.008..0.019 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)
Planning time : 3.565 ms