explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lueJ

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 176.067 17,781.873 ↓ 9.4 795,804 1

Gather (cost=701,029.40..3,074,553.71 rows=84,374 width=24) (actual time=3,431.495..17,781.873 rows=795,804 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
2. 1,205.119 17,605.806 ↓ 7.5 265,268 3 / 3

Hash Join (cost=700,029.40..3,065,116.31 rows=35,156 width=24) (actual time=3,613.102..17,605.806 rows=265,268 loops=3)

  • Hash Cond: ("Ras".fk_detalhamento = "Ras.Det".codigo)
3. 567.518 14,500.434 ↑ 1.2 5,744,794 3 / 3

Nested Loop (cost=1.13..2,346,508.50 rows=7,077,924 width=20) (actual time=1,709.326..14,500.434 rows=5,744,794 loops=3)

4. 2,403.533 2,403.533 ↑ 1.2 678,199 3 / 3

Parallel Index Only Scan Backward using idx_codigo_cadastro on "Remessa" (cost=0.56..469,250.93 rows=791,913 width=12) (actual time=1,709.248..2,403.533 rows=678,199 loops=3)

  • Index Cond: (data_cadastro > '2020-08-01 00:00:00-03'::timestamp with time zone)
  • Heap Fetches: 185,765
5. 11,529.383 11,529.383 ↑ 3.4 8 2,034,597 / 3

Index Only Scan using "Rastreamento_fk_remessa_fk_detalhamento_idx" on "Rastreamento" "Ras" (cost=0.57..2.10 rows=27 width=20) (actual time=0.013..0.017 rows=8 loops=2,034,597)

  • Index Cond: (fk_remessa = ("Remessa".codigo)::text)
  • Heap Fetches: 264,556
6. 203.532 1,900.253 ↓ 1.4 799,417 3 / 3

Hash (cost=692,793.06..692,793.06 rows=578,816 width=20) (actual time=1,900.253..1,900.253 rows=799,417 loops=3)

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

Index Scan using "RastreamentoDetalhamento_data_hora_ocorrencia_fk_ocorrencia_idx" on "RastreamentoDetalhamento" "Ras.Det" (cost=0.57..692,793.06 rows=578,816 width=20) (actual time=1.326..1,696.721 rows=799,417 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[])))