explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jjxY : Optimization for: plan #lueJ

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 109.353 5,679.561 ↓ 53.6 229,446 1

Gather (cost=701,037.93..1,294,772.53 rows=4,284 width=24) (actual time=2,296.218..5,679.561 rows=229,446 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
2. 181.079 5,570.208 ↓ 42.8 76,482 3 / 3

Hash Join (cost=700,037.93..1,293,344.13 rows=1,785 width=24) (actual time=2,329.105..5,570.208 rows=76,482 loops=3)

  • Hash Cond: ("Ras".fk_detalhamento = "Ras.Det".codigo)
3. 76.255 3,076.259 ↓ 2.2 793,076 3 / 3

Nested Loop (cost=1.13..592,363.98 rows=359,374 width=20) (actual time=0.155..3,076.259 rows=793,076 loops=3)

4. 1,605.929 1,605.929 ↓ 2.3 92,938 3 / 3

Parallel Index Scan using "Remessa_data_cadastro" on "Remessa" (cost=0.56..495,414.84 rows=40,208 width=12) (actual time=0.068..1,605.929 rows=92,938 loops=3)

  • Index Cond: (data_cadastro > '2020-08-01 00:00:00-03'::timestamp with time zone)
  • Filter: (fk_ultima_ocorrencia_rastreamento = ANY ('{160,3,10,89,92}'::integer[]))
  • Rows Removed by Filter: 585,414
5. 1,394.075 1,394.075 ↑ 3.0 9 278,815 / 3

Index Only Scan using "Rastreamento_fk_remessa_fk_detalhamento_idx" on "Rastreamento" "Ras" (cost=0.57..2.14 rows=27 width=20) (actual time=0.013..0.015 rows=9 loops=278,815)

  • Index Cond: (fk_remessa = ("Remessa".codigo)::text)
  • Heap Fetches: 26,682
6. 207.433 2,312.870 ↓ 1.4 799,425 3 / 3

Hash (cost=692,801.56..692,801.56 rows=578,819 width=20) (actual time=2,312.870..2,312.870 rows=799,425 loops=3)

  • Buckets: 1,048,576 Batches: 1 Memory Usage: 51,911kB
7. 2,105.437 2,105.437 ↓ 1.4 799,425 3 / 3

Index Scan using "RastreamentoDetalhamento_data_hora_ocorrencia_fk_ocorrencia_idx" on "RastreamentoDetalhamento" "Ras.Det" (cost=0.57..692,801.56 rows=578,819 width=20) (actual time=1.813..2,105.437 rows=799,425 loops=3)

  • Index Cond: ((data_hora_ocorrencia >= '2020-08-17 00:00:00-03'::timestamp with time zone) AND (data_hora_ocorrencia <= '2020-09-15 20:59:00-03'::timestamp with time zone) AND (fk_ocorrencia = ANY ('{160,3,10,89,92}'::integer[])))