explain.depesz.com

PostgreSQL's explain analyze made readable

Result: iMjA : Optimization for: plan #MGB3

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.318 40,031.883 ↑ 57.3 336 1

Hash Join (cost=149.92..953,695.30 rows=19,241 width=105) (actual time=714.520..40,031.883 rows=336 loops=1)

  • Hash Cond: ("Remessa".fk_servico = "Servico".codigo)
2. 40,029.603 40,029.603 ↑ 57.8 336 1

Index Scan using "Remessa_atualizacao_status_correios" on "Remessa" (cost=0.56..953,280.67 rows=19,431 width=49) (actual time=712.523..40,029.603 rows=336 loops=1)

  • Index Cond: ((data_cadastro >= '2020-01-01 00:00:00-03'::timestamp with time zone) AND (data_cadastro <= '2020-01-31 23:59:00-03'::timestamp with time zone) AND (fk_situacao_remessa = ANY ('{20,7,18,32}'::integer[])))
  • Filter: ((fk_cliente = 2) AND (fk_tipo_remessa = ANY ('{1,3,4}'::integer[])))
  • Rows Removed by Filter: 385,855
3. 0.252 1.962 ↑ 1.0 203 1

Hash (cost=146.82..146.82 rows=203 width=64) (actual time=1.962..1.962 rows=203 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 28kB
4. 0.261 1.710 ↑ 1.0 203 1

Hash Left Join (cost=3.19..146.82 rows=203 width=64) (actual time=0.132..1.710 rows=203 loops=1)

  • Hash Cond: ("Servico".fk_cliente = "Servico.Cliente".codigo)
5. 1.361 1.361 ↑ 1.0 203 1

Seq Scan on "Servico" (cost=0.00..143.05 rows=203 width=29) (actual time=0.029..1.361 rows=203 loops=1)

  • Filter: (show_dashboard IS NOT FALSE)
  • Rows Removed by Filter: 2
6. 0.042 0.088 ↑ 1.0 53 1

Hash (cost=2.53..2.53 rows=53 width=39) (actual time=0.088..0.088 rows=53 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 12kB
7. 0.046 0.046 ↑ 1.0 53 1

Seq Scan on "Cliente" "Servico.Cliente" (cost=0.00..2.53 rows=53 width=39) (actual time=0.009..0.046 rows=53 loops=1)