explain.depesz.com

PostgreSQL's explain analyze made readable

Result: w8vV : Optimization for: plan #HwjM

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.014 82.968 ↑ 1.0 1 1

Aggregate (cost=64,241.81..64,241.82 rows=1 width=8) (actual time=82.968..82.968 rows=1 loops=1)

2. 0.049 82.954 ↑ 2.5 13 1

Nested Loop Left Join (cost=1,343.76..64,241.73 rows=33 width=4) (actual time=76.293..82.954 rows=13 loops=1)

  • Filter: ((selo_analisado.cs_situacao_isento <> 2) OR (selo_analisado.cs_situacao_isento IS NULL))
3. 1.674 82.723 ↑ 2.8 13 1

Hash Join (cost=1,343.34..64,206.24 rows=36 width=8) (actual time=76.263..82.723 rows=13 loops=1)

  • Hash Cond: (selo.id_selo_compensado = selo_compensado.id_selo_compensado)
4. 76.744 80.845 ↓ 1.1 22,254 1

Bitmap Heap Scan on selo (cost=446.11..63,254.28 rows=20,847 width=12) (actual time=6.739..80.845 rows=22,254 loops=1)

  • Recheck Cond: ((id_cartorio = 82) AND (cs_situacao_selo = 0))
  • Heap Blocks: exact=14,496
5. 4.101 4.101 ↓ 1.1 22,254 1

Bitmap Index Scan on selo_cs_situacao_selo_cartorio_idx (cost=0.00..440.90 rows=20,847 width=0) (actual time=4.101..4.101 rows=22,254 loops=1)

  • Index Cond: ((id_cartorio = 82) AND (cs_situacao_selo = 0))
6. 0.032 0.204 ↑ 1.6 200 1

Hash (cost=893.32..893.32 rows=313 width=4) (actual time=0.204..0.204 rows=200 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 16kB
7. 0.121 0.172 ↑ 1.6 200 1

Bitmap Heap Scan on selo_compensado (cost=13.19..893.32 rows=313 width=4) (actual time=0.061..0.172 rows=200 loops=1)

  • Recheck Cond: ((cs_situacao_compensado IS NOT NULL) AND (cs_situacao_compensado = 1) AND (dt_recurso >= '2020-07-01 00:00:00'::timestamp without time zone) AND (dt_recurso <= '2020-07-31 23:59:59'::timestamp without time zone))
  • Heap Blocks: exact=56
8. 0.051 0.051 ↑ 1.6 200 1

Bitmap Index Scan on selo_compensado_cs_situacao_compensado_dt_recurso_idx (cost=0.00..13.12 rows=313 width=0) (actual time=0.051..0.051 rows=200 loops=1)

  • Index Cond: ((cs_situacao_compensado IS NOT NULL) AND (cs_situacao_compensado = 1) AND (dt_recurso >= '2020-07-01 00:00:00'::timestamp without time zone) AND (dt_recurso <= '2020-07-31 23:59:59'::timestamp without time zone))
9. 0.182 0.182 ↑ 1.0 1 13

Index Scan using selo_analisado_pkey on selo_analisado (cost=0.42..0.97 rows=1 width=8) (actual time=0.014..0.014 rows=1 loops=13)

  • Index Cond: (id_selo_analisado = selo.id_selo_analisado)