explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5RiJ

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 163.122 ↑ 3.7 75 1

Finalize GroupAggregate (cost=229,475.62..229,551.71 rows=275 width=12) (actual time=162.772..163.122 rows=75 loops=1)

  • Group Key: selo.id_cartorio
2. 9.681 168.220 ↑ 3.0 184 1

Gather Merge (cost=229,475.62..229,546.21 rows=550 width=12) (actual time=162.738..168.220 rows=184 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 0.149 158.539 ↑ 4.5 61 3 / 3

Partial GroupAggregate (cost=228,475.60..228,482.70 rows=275 width=12) (actual time=158.366..158.539 rows=61 loops=3)

  • Group Key: selo.id_cartorio
4. 0.203 158.390 ↑ 1.4 419 3 / 3

Sort (cost=228,475.60..228,477.05 rows=580 width=8) (actual time=158.352..158.390 rows=419 loops=3)

  • Sort Key: selo.id_cartorio
  • Sort Method: quicksort Memory: 46kB
  • Worker 0: Sort Method: quicksort Memory: 43kB
  • Worker 1: Sort Method: quicksort Memory: 43kB
5. 0.299 158.187 ↑ 1.4 419 3 / 3

Nested Loop Left Join (cost=5,621.27..228,448.98 rows=580 width=8) (actual time=116.629..158.187 rows=419 loops=3)

  • Filter: ((selo_analisado.cs_situacao_isento <> 2) OR (selo_analisado.cs_situacao_isento IS NULL))
6. 3.981 156.211 ↑ 1.5 419 3 / 3

Parallel Hash Join (cost=5,620.85..228,114.43 rows=627 width=12) (actual time=116.589..156.211 rows=419 loops=3)

  • Hash Cond: (selo.id_selo_compensado = selo_compensado.id_selo_compensado)
7. 142.307 150.977 ↑ 1.7 31,736 3 / 3

Parallel Bitmap Heap Scan on selo (cost=2,609.40..224,960.45 rows=54,300 width=16) (actual time=78.409..150.977 rows=31,736 loops=3)

  • Recheck Cond: (cs_isento OR cs_gratuito)
  • Filter: ((cs_isento OR cs_gratuito) AND (id_selo_compensado IS NOT NULL) AND (cs_situacao_selo = 0))
  • Rows Removed by Filter: 9,965
  • Heap Blocks: exact=21,824
8. 0.001 8.670 ↓ 0.0 0 1 / 3

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

9. 4.120 4.120 ↓ 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.361..12.361 rows=121,504 loops=1)

  • Index Cond: (cs_isento = true)
10. 4.549 4.549 ↓ 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.647..13.647 rows=153,810 loops=1)

  • Index Cond: (cs_gratuito = true)
11. 0.140 1.253 ↑ 2.9 425 3 / 3

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

  • Buckets: 4,096 Batches: 1 Memory Usage: 96kB
12. 0.561 1.113 ↓ 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.716..3.338 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
13. 0.551 0.551 ↑ 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.654..1.654 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))
14. 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)