explain.depesz.com

PostgreSQL's explain analyze made readable

Result: frYh

Settings
# exclusive inclusive rows x rows loops node
1. 0.010 100.712 ↑ 1.0 1 1

Aggregate (cost=65,189.83..65,189.84 rows=1 width=8) (actual time=100.712..100.712 rows=1 loops=1)

2. 0.020 100.702 ↑ 2.5 13 1

Nested Loop Left Join (cost=1,861.20..65,189.74 rows=33 width=4) (actual time=94.661..100.702 rows=13 loops=1)

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

Hash Join (cost=1,860.78..65,154.25 rows=36 width=8) (actual time=94.638..100.578 rows=13 loops=1)

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

Bitmap Heap Scan on selo (cost=415.30..63,654.05 rows=20,847 width=12) (actual time=7.487..97.418 rows=22,254 loops=1)

  • Recheck Cond: (id_cartorio = 82)
  • Filter: (cs_situacao_selo = 0)
  • Rows Removed by Filter: 88
  • Heap Blocks: exact=16,288
5. 4.560 4.560 ↓ 1.2 24,499 1

Bitmap Index Scan on selo_id_cartorio_idx (cost=0.00..410.09 rows=21,021 width=0) (actual time=4.560..4.560 rows=24,499 loops=1)

  • Index Cond: (id_cartorio = 82)
6. 0.032 1.525 ↑ 1.6 200 1

Hash (cost=1,441.57..1,441.57 rows=313 width=4) (actual time=1.525..1.525 rows=200 loops=1)

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

Bitmap Heap Scan on selo_compensado (cost=561.45..1,441.57 rows=313 width=4) (actual time=1.194..1.493 rows=200 loops=1)

  • Recheck Cond: ((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) AND (cs_situacao_compensado IS NOT NULL) AND (cs_situacao_compensado = 1))
  • Heap Blocks: exact=56
8. 0.006 1.180 ↓ 0.0 0 1

BitmapAnd (cost=561.45..561.45 rows=313 width=0) (actual time=1.180..1.180 rows=0 loops=1)

9. 0.165 0.165 ↑ 1.0 2,330 1

Bitmap Index Scan on selo_compensado_dt_recurso_idx (cost=0.00..52.22 rows=2,380 width=0) (actual time=0.165..0.165 rows=2,330 loops=1)

  • Index Cond: ((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))
10. 1.009 1.009 ↓ 1.0 24,446 1

Bitmap Index Scan on selo_compensado_cs_situacao_compensado_idx (cost=0.00..508.82 rows=24,040 width=0) (actual time=1.009..1.009 rows=24,446 loops=1)

  • Index Cond: ((cs_situacao_compensado IS NOT NULL) AND (cs_situacao_compensado = 1))
11. 0.104 0.104 ↑ 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.008..0.008 rows=1 loops=13)

  • Index Cond: (id_selo_analisado = selo.id_selo_analisado)