# Result: FHWs : Optimization for: plan #pRZJ

Settings

### Optimization(s) for this plan:

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

(cost=9,068.28..570,930.40 rows=325 width=210) (actual time=18.029..66.875 rows=1,417 loops=1)

2. 0.007 0.007 ↑ 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.005..0.007 rows=1 loops=1)

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

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

• Workers Planned: 3
• Workers Launched: 3
4. 0.612 60.636 ↓ 3.4 354 4 / 4

(cost=8,068.13..569,890.49 rows=105 width=214) (actual time=12.726..60.636 rows=354 loops=4)

5. 0.158 55.065 ↑ 2.6 354 4 / 4

(cost=8,067.57..564,764.84 rows=931 width=135) (actual time=12.670..55.065 rows=354 loops=4)

6. 3.410 52.781 ↑ 1.2 354 4 / 4

(cost=8,067.00..215,890.80 rows=433 width=115) (actual time=12.642..52.781 rows=354 loops=4)

• Hash Cond: ("Ras.Det".fk_usuario = "Ras.Det.ResponsavelLancamento".codigo)
7. 45.022 45.022 ↑ 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.023..45.022 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: 12080
8. 0.019 4.349 ↓ 1.2 52 4 / 4

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

• Buckets: 1024 Batches: 1 Memory Usage: 13kB
9. 2.765 4.330 ↓ 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=1.803..4.330 rows=52 loops=4)

• Recheck Cond: (fk_entregador IS NOT NULL)
• Filter: ((codigo <> 10) AND (fk_courier = 53))
• Rows Removed by Filter: 3133
• Heap Blocks: exact=1628
10. 1.565 1.565 ↓ 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=1.565..1.565 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.005..0.006 rows=1 loops=1,417)

• Index Cond: (fk_detalhamento = "Ras.Det".codigo)
12. 4.960 4.960 ↑ 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.014..0.014 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)
 Planning time : 0.789 ms