explain.depesz.com

PostgreSQL's explain analyze made readable

Result: obY

Settings
# exclusive inclusive rows x rows loops node
1. 211.564 9,957.522 ↓ 179.0 179 1

Aggregate (cost=2,140,174.16..2,140,174.19 rows=1 width=68) (actual time=9,548.646..9,957.522 rows=179 loops=1)

  • Filter: (sum(lancamentos_result.valor) <> '0'::numeric)
  • Buffers: shared hit=7,525,682 read=553,411, temp read=15,513 written=15,577
2. 645.606 9,745.958 ↓ 1,019,000.0 1,019,000 1

Sort (cost=2,140,174.16..2,140,174.16 rows=1 width=42) (actual time=9,513.688..9,745.958 rows=1,019,000 loops=1)

  • Sort Key: cc.id_estrutura_contabil_grupo_economico, (to_char(lancamentos_result.dt, 'yyyy-MM'::text))
  • Sort Method: external merge Disk: 28,728kB
  • Buffers: shared hit=7,525,682 read=553,411, temp read=15,513 written=15,577
3. 693.451 9,100.352 ↓ 1,019,000.0 1,019,000 1

Hash Join (cost=2,103,549.35..2,140,174.15 rows=1 width=42) (actual time=6,552.705..9,100.352 rows=1,019,000 loops=1)

  • Buffers: shared hit=7,525,682 read=553,411, temp read=10,146 written=10,184
4. 147.603 8,406.624 ↓ 728.9 1,019,064 1

Subquery Scan on lancamentos_result (cost=2,101,727.62..2,138,348.74 rows=1,398 width=18) (actual time=6,552.408..8,406.624 rows=1,019,064 loops=1)

  • Filter: (lancamentos_result.contador = 2)
  • Buffers: shared hit=7,525,667 read=553,411, temp read=10,146 written=10,184
5. 859.710 8,259.021 ↓ 3.6 1,019,064 1

WindowAgg (cost=2,101,727.62..2,134,853.79 rows=279,596 width=1,056) (actual time=6,552.407..8,259.021 rows=1,019,064 loops=1)

  • Buffers: shared hit=7,525,667 read=553,411, temp read=10,146 written=10,184
6. 312.716 7,399.311 ↓ 3.6 1,019,064 1

Group (cost=2,101,727.62..2,130,659.85 rows=279,596 width=34) (actual time=6,552.385..7,399.311 rows=1,019,064 loops=1)

  • Buffers: shared hit=7,525,667 read=553,411, temp read=10,146 written=10,184
7. 292.323 7,086.595 ↓ 5.7 1,333,338 1

Gather Merge (cost=2,101,727.62..2,129,494.87 rows=232,996 width=34) (actual time=6,552.38..7,086.595 rows=1,333,338 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
  • Buffers: shared hit=7,525,667 read=553,411, temp read=10,146 written=10,184
8. 149.785 6,794.272 ↓ 3.8 444,446 3 / 3

Group (cost=2,100,727.6..2,101,601.33 rows=116,498 width=34) (actual time=6,533.427..6,794.272 rows=444,446 loops=3)

  • Buffers: shared hit=7,525,667 read=553,411, temp read=10,146 written=10,184
9. 365.929 6,644.487 ↓ 4.3 501,429 3 / 3

Sort (cost=2,100,727.6..2,101,018.84 rows=116,498 width=34) (actual time=6,533.422..6,644.487 rows=501,429 loops=3)

  • Sort Key: lr.id, cegr.id_etiqueta_gerencial
  • Sort Method: external merge Disk: 18,928kB
  • Buffers: shared hit=7,525,667 read=553,411, temp read=10,146 written=10,184
10. 392.472 6,278.558 ↓ 4.3 501,429 3 / 3

Nested Loop (cost=0.56..2,087,735.82 rows=116,498 width=34) (actual time=548.052..6,278.558 rows=501,429 loops=3)

  • Buffers: shared hit=7,525,653 read=553,411
11. 4,381.798 4,381.798 ↓ 4.3 501,429 3 / 3

Seq Scan on categoria_etiqueta_gerencial_razao cegr (cost=0..1,262,982.9 rows=116,498 width=16) (actual time=547.969..4,381.798 rows=501,429 loops=3)

  • Filter: ((cegr.id_etiqueta_gerencial = ANY ('{11,13}'::bigint[])) AND (cegr.dt_lancamento_razao >= '2020-01-01 00:00:00'::timestamp without time zone) AND (cegr.dt_lancamento_razao <= '2020-05-31 00:00:00'::timestamp without time zone) AND (cegr.id_empresa_lancamento_razao = ANY ('{3249,3635,3237,3254,3255,3256,3257,3258,3259}'::bigint[])))
  • Buffers: shared hit=99 read=553,411
12. 1,504.288 1,504.288 ↑ 1.0 1 1,504,288 / 3

Index Scan using lancamento_razao_primary_index on lancamento_razao lr (cost=0.56..7.08 rows=1 width=26) (actual time=0.003..0.003 rows=1 loops=1,504,288)

  • Index Cond: (lr.id = cegr.id_lancamento_razao)
  • Buffers: shared hit=7,525,554
13. 0.080 0.277 ↓ 1.8 569 1

Hash (cost=1,817.77..1,817.77 rows=317 width=8) (actual time=0.276..0.277 rows=569 loops=1)

  • Buffers: shared hit=15
14. 0.159 0.197 ↓ 1.8 569 1

Bitmap Heap Scan on conta_contabil cc (cost=12.58..1,817.77 rows=317 width=8) (actual time=0.05..0.197 rows=569 loops=1)

  • Filter: (cc.id_estrutura_contabil_grupo_economico IS NOT NULL)
  • Heap Blocks: exact=10
  • Buffers: shared hit=15
15. 0.038 0.038 ↓ 1.2 635 1

Bitmap Index Scan on orcamento_hotfix_2 (cost=0..12.51 rows=544 width=0) (actual time=0.038..0.038 rows=635 loops=1)

  • Index Cond: (cc.id_grupo_economico = 1,326)
  • Buffers: shared hit=5
Planning time : 0.57 ms
Execution time : 9,964.983 ms