explain.depesz.com

PostgreSQL's explain analyze made readable

Result: SlUP : Optimization for: Optimization for: Optimization for: plan #Edtb; plan #8cRc; plan #UhQx

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.007 30.045 ↑ 1.0 1 1

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

2. 0.018 30.038 ↑ 2.5 13 1

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

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

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

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

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

  • Recheck Cond: ((id_cartorio = 82) AND (cs_situacao_selo = 0))
  • Heap Blocks: exact=14,496
5. 3.074 3.074 ↓ 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=3.073..3.074 rows=22,254 loops=1)

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

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

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

Bitmap Heap Scan on selo_compensado (cost=13.19..893.32 rows=313 width=4) (actual time=0.172..0.298 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.159 0.159 ↑ 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.159..0.159 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.026 0.026 ↑ 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.002..0.002 rows=1 loops=13)

  • Index Cond: (id_selo_analisado = selo.id_selo_analisado)