explain.depesz.com

PostgreSQL's explain analyze made readable

Result: AVfC : with_anexo_imagem

Settings
# exclusive inclusive rows x rows loops node
1. 1,394.384 15,215.573 ↓ 1.1 2,933,932 1

Finalize GroupAggregate (cost=421,033.10..867,794.48 rows=2,680,136 width=14) (actual time=10,347.246..15,215.573 rows=2,933,932 loops=1)

  • Group Key: cc.cd_ctrc
2. 1,796.915 13,821.189 ↓ 1.1 2,933,959 1

Gather Merge (cost=421,033.10..749,565.90 rows=2,593,680 width=16) (actual time=10,347.240..13,821.189 rows=2,933,959 loops=1)

  • Workers Planned: 3
  • Workers Launched: 3
3. 811.728 12,024.274 ↑ 1.2 733,490 4 / 4

Partial GroupAggregate (cost=420,033.06..443,808.46 rows=864,560 width=16) (actual time=10,286.437..12,024.274 rows=733,490 loops=4)

  • Group Key: cc.cd_ctrc
4. 2,794.422 11,212.546 ↓ 1.9 1,616,152 4 / 4

Sort (cost=420,033.06..422,194.46 rows=864,560 width=239) (actual time=10,286.423..11,212.546 rows=1,616,152 loops=4)

  • Sort Key: cc.cd_ctrc
  • Sort Method: external merge Disk: 247,488kB
  • Worker 0: Sort Method: external merge Disk: 246,152kB
  • Worker 1: Sort Method: external merge Disk: 244,296kB
  • Worker 2: Sort Method: external merge Disk: 236,584kB
5. 3,885.261 8,418.124 ↓ 1.9 1,616,152 4 / 4

Parallel Hash Left Join (cost=184,516.54..277,663.40 rows=864,560 width=239) (actual time=5,114.754..8,418.124 rows=1,616,152 loops=4)

  • Hash Cond: (cq.cd_ctrc = ci.cd_ctrc)
6. 1,620.238 3,337.365 ↓ 1.6 1,352,148 4 / 4

Parallel Hash Left Join (cost=75,544.85..129,424.91 rows=861,173 width=14) (actual time=2,125.545..3,337.365 rows=1,352,148 loops=4)

  • Hash Cond: (cq.cd_ctrc = cc.cd_ctrc)
  • Filter: ((ce.id_uso IS NULL) OR (ce.id_uso <> 2))
  • Rows Removed by Filter: 31,944
7. 173.643 173.643 ↑ 1.3 787,090 4 / 4

Parallel Seq Scan on ctrc_quebra cq (cost=0.00..30,235.17 rows=1,015,617 width=4) (actual time=0.016..173.643 rows=787,090 loops=4)

8. 557.681 1,543.484 ↑ 1.0 1,334,470 4 / 4

Parallel Hash (cost=52,341.62..52,341.62 rows=1,334,818 width=12) (actual time=1,543.484..1,543.484 rows=1,334,470 loops=4)

  • Buckets: 1,048,576 Batches: 8 Memory Usage: 39,584kB
9. 680.788 985.803 ↑ 1.0 1,334,470 4 / 4

Hash Left Join (cost=1.09..52,341.62 rows=1,334,818 width=12) (actual time=0.060..985.803 rows=1,334,470 loops=4)

  • Hash Cond: (cc.cd_comprovante = ce.cd_comprovante)
10. 304.987 304.987 ↑ 1.0 1,334,470 4 / 4

Parallel Seq Scan on ctrc_comprovante cc (cost=0.00..45,124.18 rows=1,334,818 width=10) (actual time=0.020..304.987 rows=1,334,470 loops=4)

11. 0.005 0.028 ↑ 1.0 4 4 / 4

Hash (cost=1.04..1.04 rows=4 width=10) (actual time=0.027..0.028 rows=4 loops=4)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
12. 0.023 0.023 ↑ 1.0 4 4 / 4

Seq Scan on comprovante_entrega ce (cost=0.00..1.04 rows=4 width=10) (actual time=0.022..0.023 rows=4 loops=4)

13. 468.278 1,195.498 ↓ 1.0 794,323 4 / 4

Parallel Hash (cost=73,628.20..73,628.20 rows=790,199 width=233) (actual time=1,195.498..1,195.498 rows=794,323 loops=4)

  • Buckets: 262,144 Batches: 16 Memory Usage: 40,704kB
14. 727.220 727.220 ↓ 1.0 794,323 4 / 4

Parallel Seq Scan on ctrc_imagem ci (cost=0.00..73,628.20 rows=790,199 width=233) (actual time=0.039..727.220 rows=794,323 loops=4)

  • Filter: ((id_validacao IS NULL) OR (id_validacao <> 0))
  • Rows Removed by Filter: 1,765
Planning time : 1.919 ms
Execution time : 15,693.750 ms