explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Gik

Settings
# exclusive inclusive rows x rows loops node
1. 0.021 164.361 ↑ 3.7 75 1

Sort (cost=229,565.40..229,566.09 rows=275 width=12) (actual time=164.356..164.361 rows=75 loops=1)

  • Sort Key: (count(selo.id_selo)) DESC
  • Sort Method: quicksort Memory: 28kB
2. 0.000 164.340 ↑ 3.7 75 1

Finalize GroupAggregate (cost=229,478.15..229,554.26 rows=275 width=12) (actual time=164.124..164.340 rows=75 loops=1)

  • Group Key: selo.id_cartorio
3. 8.947 169.480 ↑ 2.9 187 1

Gather Merge (cost=229,478.15..229,548.76 rows=550 width=12) (actual time=164.103..169.480 rows=187 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
4. 0.108 160.533 ↑ 4.4 62 3 / 3

Partial GroupAggregate (cost=228,478.13..228,485.25 rows=275 width=12) (actual time=160.399..160.533 rows=62 loops=3)

  • Group Key: selo.id_cartorio
5. 0.218 160.425 ↑ 1.4 419 3 / 3

Sort (cost=228,478.13..228,479.59 rows=583 width=8) (actual time=160.391..160.425 rows=419 loops=3)

  • Sort Key: selo.id_cartorio
  • Sort Method: quicksort Memory: 46kB
  • Worker 0: Sort Method: quicksort Memory: 42kB
  • Worker 1: Sort Method: quicksort Memory: 44kB
6. 0.354 160.207 ↑ 1.4 419 3 / 3

Nested Loop Left Join (cost=5,621.59..228,451.35 rows=583 width=8) (actual time=118.994..160.207 rows=419 loops=3)

  • Filter: ((selo_analisado.cs_situacao_isento <> 2) OR (selo_analisado.cs_situacao_isento IS NULL))
7. 4.602 158.176 ↑ 1.5 419 3 / 3

Parallel Hash Join (cost=5,621.18..228,115.48 rows=630 width=12) (actual time=118.950..158.176 rows=419 loops=3)

  • Hash Cond: (selo.id_selo_compensado = selo_compensado.id_selo_compensado)
8. 143.791 152.471 ↑ 1.3 40,788 3 / 3

Parallel Bitmap Heap Scan on selo (cost=2,609.73..224,960.78 rows=54,573 width=16) (actual time=39.210..152.471 rows=40,788 loops=3)

  • Recheck Cond: (cs_isento OR cs_gratuito)
  • Filter: ((cs_isento OR cs_gratuito) AND (cs_situacao_selo = 0))
  • Rows Removed by Filter: 913
  • Heap Blocks: exact=21,628
9. 0.001 8.680 ↓ 0.0 0 1 / 3

BitmapOr (cost=2,609.73..2,609.73 rows=133,251 width=0) (actual time=26.041..26.041 rows=0 loops=1)

10. 4.200 4.200 ↓ 2.4 121,504 1 / 3

Bitmap Index Scan on selo_cs_isento_idx (cost=0.00..967.88 rows=50,593 width=0) (actual time=12.601..12.601 rows=121,504 loops=1)

  • Index Cond: (cs_isento = true)
11. 4.479 4.479 ↓ 1.9 153,810 1 / 3

Bitmap Index Scan on selo_cs_gratuito_idx (cost=0.00..1,576.37 rows=82,658 width=0) (actual time=13.437..13.437 rows=153,810 loops=1)

  • Index Cond: (cs_gratuito = true)
12. 0.124 1.103 ↑ 2.9 425 3 / 3

Parallel Hash (cost=2,995.96..2,995.96 rows=1,239 width=4) (actual time=1.103..1.103 rows=425 loops=3)

  • Buckets: 4,096 Batches: 1 Memory Usage: 96kB
13. 0.450 0.979 ↓ 1.0 1,276 1 / 3

Parallel Bitmap Heap Scan on selo_compensado (cost=486.13..2,995.96 rows=1,239 width=4) (actual time=1.638..2.936 rows=1,276 loops=1)

  • Recheck Cond: ((dt_recurso >= '2020-06-01 00:00:00'::timestamp without time zone) AND (dt_recurso <= '2020-06-30 23:59:59'::timestamp without time zone) AND (cs_situacao_compensado IS NOT NULL) AND (cs_situacao_compensado = 1))
  • Heap Blocks: exact=214
14. 0.528 0.528 ↑ 1.7 1,276 1 / 3

Bitmap Index Scan on selo_compensado_cs_situacao_compensado_dt_recurso_idx (cost=0.00..485.60 rows=2,107 width=0) (actual time=1.585..1.585 rows=1,276 loops=1)

  • Index Cond: ((dt_recurso >= '2020-06-01 00:00:00'::timestamp without time zone) AND (dt_recurso <= '2020-06-30 23:59:59'::timestamp without time zone) AND (cs_situacao_compensado IS NOT NULL) AND (cs_situacao_compensado = 1))
15. 1.677 1.677 ↑ 1.0 1 1,258 / 3

Index Scan using selo_analisado_pkey on selo_analisado (cost=0.42..0.52 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=1,258)

  • Index Cond: (id_selo_analisado = selo.id_selo_analisado)