explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Ae3B

Settings
# exclusive inclusive rows x rows loops node
1. 0.007 12.413 ↑ 91.0 1 1

Sort (cost=5,780.78..5,781.01 rows=91 width=12) (actual time=12.412..12.413 rows=1 loops=1)

  • Sort Key: (count(selo.tx_numero_selo)) DESC
  • Sort Method: quicksort Memory: 25kB
2. 0.010 12.406 ↑ 91.0 1 1

GroupAggregate (cost=1,332.07..5,777.82 rows=91 width=12) (actual time=12.406..12.406 rows=1 loops=1)

  • Group Key: selo.id_cartorio
3. 0.068 12.396 ↑ 10.1 9 1

Nested Loop (cost=1,332.07..5,776.46 rows=91 width=33) (actual time=8.596..12.396 rows=9 loops=1)

4. 0.341 11.911 ↑ 1.0 139 1

Nested Loop Left Join (cost=1,331.65..4,733.41 rows=141 width=37) (actual time=8.418..11.911 rows=139 loops=1)

  • Filter: ((selo_compensado.cs_situacao_compensado IS NULL) OR (selo_compensado.automatico AND (selo_compensado.cs_situacao_compensado <> ALL ('{0,1}'::integer[]))))
  • Rows Removed by Filter: 417
5. 1.141 9.346 ↓ 1.9 556 1

Bitmap Heap Scan on selo (cost=1,331.23..2,538.41 rows=300 width=41) (actual time=8.410..9.346 rows=556 loops=1)

  • Recheck Cond: (id_cartorio = 82)
  • Filter: (cs_isento AND (NOT cs_gratuito) AND (cs_situacao_selo = 0))
  • Rows Removed by Filter: 6
  • Heap Blocks: exact=547
6. 0.873 8.205 ↓ 0.0 0 1

BitmapAnd (cost=1,331.23..1,331.23 rows=309 width=0) (actual time=8.205..8.205 rows=0 loops=1)

7. 4.316 4.316 ↓ 1.1 24,499 1

Bitmap Index Scan on selo_id_cartorio_idx (cost=0.00..450.12 rows=23,158 width=0) (actual time=4.316..4.316 rows=24,499 loops=1)

  • Index Cond: (id_cartorio = 82)
8. 3.016 3.016 ↓ 1.0 48,581 1

Bitmap Index Scan on selo_cs_isento_idx (cost=0.00..880.72 rows=47,505 width=0) (actual time=3.016..3.016 rows=48,581 loops=1)

  • Index Cond: (cs_isento = true)
9. 2.224 2.224 ↑ 1.0 1 556

Index Scan using selo_compensado_pkey on selo_compensado (cost=0.42..7.30 rows=1 width=9) (actual time=0.004..0.004 rows=1 loops=556)

  • Index Cond: (id_selo_compensado = selo.id_selo_compensado)
10. 0.417 0.417 ↓ 0.0 0 139

Index Scan using selo_analisado_pkey on selo_analisado (cost=0.42..7.40 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=139)

  • Index Cond: (id_selo_analisado = selo.id_selo_analisado)
  • Filter: (cs_situacao_isento = 0)
  • Rows Removed by Filter: 1