explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8gct

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.066 13,975.931 ↓ 1.7 100 1

Sort (cost=4,036,947.29..4,036,947.44 rows=60 width=168) (actual time=13,975.928..13,975.931 rows=100 loops=1)

  • Sort Key: labelechart.labelechart_datec DESC, labelechart.labelechart_id
  • Sort Method: quicksort Memory: 47kB
2. 0.033 13,975.865 ↓ 1.7 100 1

Merge Left Join (cost=4,036,878.33..4,036,945.52 rows=60 width=168) (actual time=13,975.684..13,975.865 rows=100 loops=1)

  • Merge Cond: (labelechart.labelechart_id = echangearticle_2.echangearticle_labelechart_id)
3. 0.028 11,802.469 ↓ 1.7 100 1

Merge Left Join (cost=2,310,501.63..2,310,546.47 rows=60 width=152) (actual time=11,802.337..11,802.469 rows=100 loops=1)

  • Merge Cond: (labelechart.labelechart_id = echangearticle_1.echangearticle_labelechart_id)
4. 0.041 11,262.192 ↓ 1.7 100 1

Merge Left Join (cost=1,725,787.88..1,725,810.38 rows=60 width=140) (actual time=11,262.116..11,262.192 rows=100 loops=1)

  • Merge Cond: (labelechart.labelechart_id = echangearticle.echangearticle_labelechart_id)
5. 0.042 1.290 ↓ 1.7 100 1

Sort (cost=114.77..114.92 rows=60 width=128) (actual time=1.283..1.290 rows=100 loops=1)

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

Seq Scan on labelechart (cost=0.00..113.00 rows=60 width=128) (actual time=0.546..1.248 rows=100 loops=1)

  • Filter: ((labelechart_dossier_id = 148) AND (lower(unaccent((labelechart_lib)::text)) <> 'recuperation unitaire'::text))
  • Rows Removed by Filter: 3053
7. 0.030 11,260.861 ↑ 10.7 55 1

Finalize GroupAggregate (cost=1,725,673.11..1,725,687.84 rows=589 width=12) (actual time=11,260.827..11,260.861 rows=55 loops=1)

  • Group Key: echangearticle.echangearticle_labelechart_id
8. 0.000 11,260.831 ↑ 8.4 140 1

Sort (cost=1,725,673.11..1,725,676.06 rows=1,178 width=12) (actual time=11,260.822..11,260.831 rows=140 loops=1)

  • Sort Key: echangearticle.echangearticle_labelechart_id
  • Sort Method: quicksort Memory: 31kB
9. 7.171 11,260.845 ↑ 8.4 140 1

Gather (cost=1,725,489.33..1,725,613.02 rows=1,178 width=12) (actual time=11,255.843..11,260.845 rows=140 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
10. 123.544 11,253.674 ↑ 12.5 47 3

Partial HashAggregate (cost=1,724,489.33..1,724,495.22 rows=589 width=12) (actual time=11,253.663..11,253.674 rows=47 loops=3)

  • Group Key: echangearticle.echangearticle_labelechart_id
11. 11,130.130 11,130.130 ↓ 2.3 563,807 3

Parallel Seq Scan on echangearticle (cost=0.00..1,723,259.81 rows=245,905 width=4) (actual time=23.608..11,130.130 rows=563,807 loops=3)

  • Filter: ((echangearticle_datetraitement IS NULL) AND (echangearticle_dossier_id = 148))
  • Rows Removed by Filter: 3258299
12. 0.027 540.249 ↑ 11.3 52 1

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

  • Group Key: echangearticle_1.echangearticle_labelechart_id
13. 0.000 540.222 ↑ 8.8 134 1

Sort (cost=584,713.74..584,716.69 rows=1,178 width=12) (actual time=540.214..540.222 rows=134 loops=1)

  • Sort Key: echangearticle_1.echangearticle_labelechart_id
  • Sort Method: quicksort Memory: 31kB
14. 14.012 542.608 ↑ 8.8 134 1

Gather (cost=584,529.96..584,653.65 rows=1,178 width=12) (actual time=539.553..542.608 rows=134 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
15. 74.685 528.596 ↑ 13.1 45 3

Partial HashAggregate (cost=583,529.96..583,535.85 rows=589 width=12) (actual time=528.585..528.596 rows=45 loops=3)

  • Group Key: echangearticle_1.echangearticle_labelechart_id
16. 340.467 453.911 ↓ 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=123.687..453.911 rows=505,660 loops=3)

  • Recheck Cond: ((echangearticle_dossier_id = 148) AND (echangearticle_etat = 20))
  • Rows Removed by Index Recheck: 3194
  • Heap Blocks: exact=32994 lossy=31706
17. 113.444 113.444 ↓ 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=113.444..113.444 rows=1,516,980 loops=1)

  • Index Cond: ((echangearticle_dossier_id = 148) AND (echangearticle_etat = 20))
18. 0.020 2,173.363 ↑ 11.8 50 1

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

  • Group Key: echangearticle_2.echangearticle_labelechart_id
19. 0.000 2,173.343 ↑ 14.7 80 1

Sort (cost=1,726,376.70..1,726,379.64 rows=1,178 width=12) (actual time=2,173.339..2,173.343 rows=80 loops=1)

  • Sort Key: echangearticle_2.echangearticle_labelechart_id
  • Sort Method: quicksort Memory: 28kB
20. 100.683 2,264.212 ↑ 14.7 80 1

Gather (cost=1,726,192.92..1,726,316.61 rows=1,178 width=12) (actual time=2,173.244..2,264.212 rows=80 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
21. 0.268 2,163.529 ↑ 21.8 27 3

Partial HashAggregate (cost=1,725,192.92..1,725,198.81 rows=589 width=12) (actual time=2,163.521..2,163.529 rows=27 loops=3)

  • Group Key: echangearticle_2.echangearticle_labelechart_id
22. 2,163.261 2,163.261 ↑ 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=487.633..2,163.261 rows=1,121 loops=3)

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