explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CFcat

Settings
# exclusive inclusive rows x rows loops node
1. 334.656 4,635.199 ↓ 250.7 26,320 1

Hash Join (cost=293,807.20..317,055.12 rows=105 width=13) (actual time=4,222.149..4,635.199 rows=26,320 loops=1)

  • Hash Cond: ((b.femea_id = v.femea_id) AND (b.cobertura_mais_recente = v.data_hora_cobertura))
2.          

CTE base

3. 14.792 1,945.089 ↑ 6.4 26,296 1

Finalize GroupAggregate (cost=106,132.31..128,817.08 rows=168,663 width=12) (actual time=1,876.506..1,945.089 rows=26,296 loops=1)

  • Group Key: v_1.femea_id
4. 66.588 1,930.297 ↑ 2.5 65,112 1

Gather Merge (cost=106,132.31..126,317.67 rows=162,556 width=12) (actual time=1,876.494..1,930.297 rows=65,112 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
5. 15.974 1,863.709 ↑ 3.7 21,704 3 / 3

Partial GroupAggregate (cost=105,132.28..106,554.65 rows=81,278 width=12) (actual time=1,833.568..1,863.709 rows=21,704 loops=3)

  • Group Key: v_1.femea_id
6. 123.490 1,847.735 ↑ 1.3 64,654 3 / 3

Sort (cost=105,132.28..105,335.48 rows=81,278 width=12) (actual time=1,833.556..1,847.735 rows=64,654 loops=3)

  • Sort Key: v_1.femea_id
  • Sort Method: external merge Disk: 1,632kB
  • Worker 0: Sort Method: external merge Disk: 1,688kB
  • Worker 1: Sort Method: external merge Disk: 1,640kB
7. 1,722.535 1,724.245 ↑ 1.3 64,654 3 / 3

Parallel Bitmap Heap Scan on vw_modelo_reprodutivo v_1 (cost=85.80..98,503.83 rows=81,278 width=12) (actual time=13.172..1,724.245 rows=64,654 loops=3)

  • Recheck Cond: ((data_hora_cobertura <= '2020-08-03'::date) AND (contrato_id = 102))
  • Rows Removed by Index Recheck: 804,333
  • Heap Blocks: lossy=30,616
8. 1.710 1.710 ↑ 1.9 846,080 1 / 3

Bitmap Index Scan on vw_modelo_reprodutivo_contrato_cobertura_brin (cost=0.00..37.04 rows=1,606,482 width=0) (actual time=5.130..5.130 rows=846,080 loops=1)

  • Index Cond: ((data_hora_cobertura <= '2020-08-03'::date) AND (contrato_id = 102))
9. 1,955.882 1,955.882 ↑ 6.4 26,296 1

CTE Scan on base b (cost=0.00..3,373.26 rows=168,663 width=12) (actual time=1,876.508..1,955.882 rows=26,296 loops=1)

10. 953.189 2,344.661 ↓ 1.0 2,606,963 1

Hash (cost=110,615.85..110,615.85 rows=2,606,685 width=21) (actual time=2,344.661..2,344.661 rows=2,606,963 loops=1)

  • Buckets: 65,536 Batches: 64 Memory Usage: 2,782kB
11. 1,391.472 1,391.472 ↓ 1.0 2,606,963 1

Seq Scan on vw_modelo_reprodutivo v (cost=0.00..110,615.85 rows=2,606,685 width=21) (actual time=0.029..1,391.472 rows=2,606,963 loops=1)

Planning time : 0.476 ms
Execution time : 4,638.020 ms