explain.depesz.com

PostgreSQL's explain analyze made readable

Result: py9z

Settings
# exclusive inclusive rows x rows loops node
1. 0.019 801.553 ↑ 3.7 75 1

Sort (cost=268,143.69..268,144.38 rows=275 width=12) (actual time=801.549..801.553 rows=75 loops=1)

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

Finalize GroupAggregate (cost=267,942.78..268,132.55 rows=275 width=12) (actual time=801.305..801.534 rows=75 loops=1)

  • Group Key: selo.id_cartorio
3. 6.037 804.328 ↑ 3.0 184 1

Gather Merge (cost=267,942.78..268,127.05 rows=550 width=12) (actual time=801.287..804.328 rows=184 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
4. 0.152 798.291 ↑ 4.5 61 3 / 3

Partial GroupAggregate (cost=266,942.75..267,063.54 rows=275 width=12) (actual time=798.121..798.291 rows=61 loops=3)

  • Group Key: selo.id_cartorio
5. 0.208 798.139 ↑ 37.6 419 3 / 3

Sort (cost=266,942.75..266,982.10 rows=15,738 width=8) (actual time=798.111..798.139 rows=419 loops=3)

  • Sort Key: selo.id_cartorio
  • Sort Method: quicksort Memory: 44kB
  • Worker 0: Sort Method: quicksort Memory: 46kB
  • Worker 1: Sort Method: quicksort Memory: 43kB
6. 0.736 797.931 ↑ 37.6 419 3 / 3

Parallel Hash Left Join (cost=6,215.05..265,845.66 rows=15,738 width=8) (actual time=763.057..797.931 rows=419 loops=3)

  • Hash Cond: (selo.id_selo_analisado = selo_analisado.id_selo_analisado)
  • Filter: ((selo_analisado.cs_situacao_isento <> 2) OR (selo_analisado.cs_situacao_isento IS NULL))
7. 71.020 783.613 ↑ 40.5 419 3 / 3

Parallel Hash Join (cost=3,011.45..262,597.46 rows=16,989 width=12) (actual time=749.067..783.613 rows=419 loops=3)

  • Hash Cond: (selo.id_selo_compensado = selo_compensado.id_selo_compensado)
8. 710.500 710.500 ↑ 1.3 1,177,577 3 / 3

Parallel Seq Scan on selo (cost=0.00..255,721.53 rows=1,472,151 width=16) (actual time=0.024..710.500 rows=1,177,577 loops=3)

  • Filter: (cs_situacao_selo = 0)
  • Rows Removed by Filter: 10,038
9. 0.134 2.093 ↑ 2.9 425 3 / 3

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

  • Buckets: 4,096 Batches: 1 Memory Usage: 128kB
10. 1.532 1.959 ↑ 2.9 425 3 / 3

Parallel Bitmap Heap Scan on selo_compensado (cost=486.13..2,995.96 rows=1,239 width=4) (actual time=1.362..1.959 rows=425 loops=3)

  • 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=63
11. 0.427 0.427 ↑ 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.280..1.280 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))
12. 5.625 13.582 ↑ 1.8 25,175 3 / 3

Parallel Hash (cost=2,648.27..2,648.27 rows=44,427 width=8) (actual time=13.582..13.582 rows=25,175 loops=3)

  • Buckets: 131,072 Batches: 1 Memory Usage: 4,000kB
13. 7.957 7.957 ↑ 1.8 25,175 3 / 3

Parallel Seq Scan on selo_analisado (cost=0.00..2,648.27 rows=44,427 width=8) (actual time=0.200..7.957 rows=25,175 loops=3)