explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4W3b : Optimization for: plan #8gct

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.062 7,798.427 ↓ 1.7 101 1

Sort (cost=3,512,091.81..3,512,091.96 rows=60 width=168) (actual time=7,798.423..7,798.427 rows=101 loops=1)

  • Sort Key: labelechart.labelechart_datec DESC, labelechart.labelechart_id
  • Sort Method: quicksort Memory: 47kB
2. 0.033 7,798.365 ↓ 1.7 101 1

Merge Left Join (cost=3,512,022.85..3,512,090.04 rows=60 width=168) (actual time=7,798.152..7,798.365 rows=101 loops=1)

  • Merge Cond: (labelechart.labelechart_id = echangearticle_2.echangearticle_labelechart_id)
3. 0.033 5,791.173 ↓ 1.7 101 1

Merge Left Join (cost=1,785,646.15..1,785,691.00 rows=60 width=152) (actual time=5,791.010..5,791.173 rows=101 loops=1)

  • Merge Cond: (labelechart.labelechart_id = echangearticle_1.echangearticle_labelechart_id)
4. 0.054 5,309.381 ↓ 1.7 101 1

Merge Left Join (cost=1,200,932.41..1,200,954.91 rows=60 width=140) (actual time=5,309.288..5,309.381 rows=101 loops=1)

  • Merge Cond: (labelechart.labelechart_id = echangearticle.echangearticle_labelechart_id)
5. 0.060 0.791 ↓ 1.7 101 1

Sort (cost=90.77..90.92 rows=60 width=128) (actual time=0.784..0.791 rows=101 loops=1)

  • Sort Key: labelechart.labelechart_id
  • Sort Method: quicksort Memory: 39kB
6. 0.731 0.731 ↓ 1.7 101 1

Seq Scan on labelechart (cost=0.00..89.00 rows=60 width=128) (actual time=0.016..0.731 rows=101 loops=1)

  • Filter: (labelechart_dossier_id = 148)
  • Rows Removed by Filter: 3052
7. 0.030 5,308.536 ↑ 10.7 55 1

Finalize GroupAggregate (cost=1,200,841.64..1,200,856.36 rows=589 width=12) (actual time=5,308.498..5,308.536 rows=55 loops=1)

  • Group Key: echangearticle.echangearticle_labelechart_id
8. 0.000 5,308.506 ↑ 8.3 142 1

Sort (cost=1,200,841.64..1,200,844.58 rows=1,178 width=12) (actual time=5,308.495..5,308.506 rows=142 loops=1)

  • Sort Key: echangearticle.echangearticle_labelechart_id
  • Sort Method: quicksort Memory: 31kB
9. 10.480 5,313.474 ↑ 8.3 142 1

Gather (cost=1,200,657.86..1,200,781.55 rows=1,178 width=12) (actual time=5,307.444..5,313.474 rows=142 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
10. 85.885 5,302.994 ↑ 12.5 47 3

Partial HashAggregate (cost=1,199,657.86..1,199,663.75 rows=589 width=12) (actual time=5,302.981..5,302.994 rows=47 loops=3)

  • Group Key: echangearticle.echangearticle_labelechart_id
11. 501.362 5,217.109 ↓ 2.3 563,807 3

Parallel Bitmap Heap Scan on echangearticle (cost=14,853.71..1,198,428.33 rows=245,905 width=4) (actual time=4,770.782..5,217.109 rows=563,807 loops=3)

  • Recheck Cond: ((echangearticle_dossier_id = 148) AND (echangearticle_etattraitement = 0))
  • Rows Removed by Index Recheck: 37950
  • Heap Blocks: exact=57234 lossy=34586
12. 4,715.747 4,715.747 ↓ 2.9 1,696,545 1

Bitmap Index Scan on echangearticle_etattraitement_sk (cost=0.00..14,706.16 rows=590,173 width=0) (actual time=4,715.747..4,715.747 rows=1,696,545 loops=1)

  • Index Cond: ((echangearticle_dossier_id = 148) AND (echangearticle_etattraitement = 0))
13. 0.038 481.759 ↑ 11.3 52 1

Finalize GroupAggregate (cost=584,713.74..584,728.47 rows=589 width=12) (actual time=481.716..481.759 rows=52 loops=1)

  • Group Key: echangearticle_1.echangearticle_labelechart_id
14. 0.000 481.721 ↑ 9.0 131 1

Sort (cost=584,713.74..584,716.69 rows=1,178 width=12) (actual time=481.712..481.721 rows=131 loops=1)

  • Sort Key: echangearticle_1.echangearticle_labelechart_id
  • Sort Method: quicksort Memory: 31kB
15. 6.498 483.839 ↑ 9.0 131 1

Gather (cost=584,529.96..584,653.65 rows=1,178 width=12) (actual time=481.097..483.839 rows=131 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
16. 73.210 477.341 ↑ 13.4 44 3

Partial HashAggregate (cost=583,529.96..583,535.85 rows=589 width=12) (actual time=477.327..477.341 rows=44 loops=3)

  • Group Key: echangearticle_1.echangearticle_labelechart_id
17. 301.775 404.131 ↓ 5.9 505,660 3

Parallel Bitmap Heap Scan on echangearticle echangearticle_1 (cost=5,176.84..583,101.42 rows=85,708 width=4) (actual time=115.999..404.131 rows=505,660 loops=3)

  • Recheck Cond: ((echangearticle_dossier_id = 148) AND (echangearticle_etat = 20))
  • Rows Removed by Index Recheck: 3194
  • Heap Blocks: exact=38574 lossy=36645
18. 102.356 102.356 ↓ 7.4 1,516,980 1

Bitmap Index Scan on echangearticle_etat_sk (cost=0.00..5,125.41 rows=205,698 width=0) (actual time=102.356..102.356 rows=1,516,980 loops=1)

  • Index Cond: ((echangearticle_dossier_id = 148) AND (echangearticle_etat = 20))
19. 0.021 2,007.159 ↑ 11.8 50 1

Finalize GroupAggregate (cost=1,726,376.70..1,726,391.42 rows=589 width=12) (actual time=2,007.138..2,007.159 rows=50 loops=1)

  • Group Key: echangearticle_2.echangearticle_labelechart_id
20. 0.000 2,007.138 ↑ 14.2 83 1

Sort (cost=1,726,376.70..1,726,379.64 rows=1,178 width=12) (actual time=2,007.134..2,007.138 rows=83 loops=1)

  • Sort Key: echangearticle_2.echangearticle_labelechart_id
  • Sort Method: quicksort Memory: 28kB
21. 102.440 2,103.606 ↑ 14.2 83 1

Gather (cost=1,726,192.92..1,726,316.61 rows=1,178 width=12) (actual time=2,007.026..2,103.606 rows=83 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
22. 0.248 2,001.166 ↑ 21.0 28 3

Partial HashAggregate (cost=1,725,192.92..1,725,198.81 rows=589 width=12) (actual time=2,001.158..2,001.166 rows=28 loops=3)

  • Group Key: echangearticle_2.echangearticle_labelechart_id
23. 2,000.918 2,000.918 ↑ 344.9 1,121 3

Parallel Seq Scan on echangearticle echangearticle_2 (cost=0.00..1,723,259.81 rows=386,622 width=4) (actual time=430.567..2,000.918 rows=1,121 loops=3)

  • Filter: ((echangearticle_datetraitement IS NOT NULL) AND (echangearticle_dossier_id = 148))
  • Rows Removed by Filter: 3820984