explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tB4A : Optimization for: Optimization for: Optimization for: Optimization for: plan #pRZJ; plan #FHWs; plan #VFHl; plan #VAda

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 71.825 ↓ 4.4 1,417 1

Nested Loop (cost=9,068.28..570,930.40 rows=325 width=210) (actual time=19.425..71.825 rows=1,417 loops=1)

2. 0.009 0.009 ↑ 1.0 1 1

Index Only Scan using "Courier_pkey" on "Courier" "Ras.Det.ResponsavelLancamento.Courier" (cost=0.15..4.17 rows=1 width=4) (actual time=0.007..0.009 rows=1 loops=1)

  • Index Cond: (codigo = 53)
  • Heap Fetches: 0
3. 22.233 86.703 ↓ 4.4 1,417 1

Gather (cost=9,068.13..570,922.99 rows=325 width=214) (actual time=19.416..86.703 rows=1,417 loops=1)

  • Workers Planned: 3
  • Workers Launched: 3
4. 0.571 64.470 ↓ 3.4 354 4 / 4

Nested Loop (cost=8,068.13..569,890.49 rows=105 width=214) (actual time=13.777..64.470 rows=354 loops=4)

5. 0.280 58.585 ↑ 2.6 354 4 / 4

Nested Loop (cost=8,067.57..564,764.84 rows=931 width=135) (actual time=13.726..58.585 rows=354 loops=4)

6. 3.601 56.179 ↑ 1.2 354 4 / 4

Hash Join (cost=8,067.00..215,890.80 rows=433 width=115) (actual time=13.704..56.179 rows=354 loops=4)

  • Hash Cond: ("Ras.Det".fk_usuario = "Ras.Det.ResponsavelLancamento".codigo)
7. 47.116 47.116 ↑ 1.5 36,365 4 / 4

Parallel Index Scan using idx_rastramento_detalhamento_data_hora_ocorrencia on "RastreamentoDetalhamento" "Ras.Det" (cost=0.57..207,681.19 rows=54,500 width=60) (actual time=0.030..47.116 rows=36,365 loops=4)

  • Index Cond: ((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))
  • Filter: (fk_ocorrencia <> ALL ('{1,2,4,5,6,7,8,9,79}'::integer[]))
  • Rows Removed by Filter: 12,080
8. 0.025 5.462 ↓ 1.2 52 4 / 4

Hash (cost=8,065.87..8,065.87 rows=45 width=59) (actual time=5.462..5.462 rows=52 loops=4)

  • Buckets: 1,024 Batches: 1 Memory Usage: 13kB
9. 3.302 5.437 ↓ 1.2 52 4 / 4

Bitmap Heap Scan on "Usuario" "Ras.Det.ResponsavelLancamento" (cost=1,544.31..8,065.87 rows=45 width=59) (actual time=2.438..5.437 rows=52 loops=4)

  • Recheck Cond: (fk_entregador IS NOT NULL)
  • Filter: ((codigo <> 10) AND (fk_courier = 53))
  • Rows Removed by Filter: 3,133
  • Heap Blocks: exact=1,628
10. 2.135 2.135 ↓ 1.0 3,193 4 / 4

Bitmap Index Scan on "Usuaurio_fk_entregador_key" (cost=0.00..1,544.30 rows=3,185 width=0) (actual time=2.135..2.135 rows=3,193 loops=4)

  • Index Cond: (fk_entregador IS NOT NULL)
11. 2.126 2.126 ↑ 1,959.0 1 1,417 / 4

Index Scan using "Rastreamento_fk_detalhamento_idx" on "Rastreamento" "Ras" (cost=0.57..786.12 rows=1,959 width=28) (actual time=0.006..0.006 rows=1 loops=1,417)

  • Index Cond: (fk_detalhamento = "Ras.Det".codigo)
12. 5.314 5.314 ↑ 1.0 1 1,417 / 4

Index Scan using "Remessa_pkey" on "Remessa" (cost=0.56..5.51 rows=1 width=79) (actual time=0.015..0.015 rows=1 loops=1,417)

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