explain.depesz.com

PostgreSQL's explain analyze made readable

Result: KIbD

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 10,682.968 ↓ 13.0 13 1

Limit (cost=261,544.14..261,544.15 rows=1 width=203) (actual time=10,682.967..10,682.968 rows=13 loops=1)

2. 0.020 10,682.966 ↓ 13.0 13 1

Sort (cost=261,544.14..261,544.15 rows=1 width=203) (actual time=10,682.966..10,682.966 rows=13 loops=1)

  • Sort Key: article.article_ecommerce DESC, article.article_id
  • Sort Method: quicksort Memory: 28kB
3. 5.263 10,682.946 ↓ 13.0 13 1

Nested Loop Left Join (cost=200,018.12..261,544.13 rows=1 width=203) (actual time=10,592.022..10,682.946 rows=13 loops=1)

  • Join Filter: ((gtin1.gtin_dossier_id = article.article_dossier_id) AND (gtin1.gtin_article_id = article.article_id))
  • Rows Removed by Join Filter: 105,924
4. 0.009 10,642.999 ↓ 13.0 13 1

Nested Loop Left Join (cost=134,710.20..196,235.20 rows=1 width=194) (actual time=10,570.053..10,642.999 rows=13 loops=1)

  • Join Filter: (_actuel_profilachatprofiltaxe18__.profiltaxe_dossier_id = article.article_dossier_id)
5. 0.000 10,642.964 ↓ 13.0 13 1

Nested Loop (cost=134,709.92..196,234.88 rows=1 width=180) (actual time=10,570.045..10,642.964 rows=13 loops=1)

6. 1.591 10,625.811 ↓ 9,536.0 9,536 1

Nested Loop Left Join (cost=134,709.64..196,234.45 rows=1 width=177) (actual time=216.143..10,625.811 rows=9,536 loops=1)

  • Join Filter: (_actuel_profilachatrefachat18__.refachat_dossier_id = article.article_dossier_id)
7. 7.081 10,605.148 ↓ 9,536.0 9,536 1

Nested Loop Left Join (cost=134,709.21..196,225.99 rows=1 width=168) (actual time=216.136..10,605.148 rows=9,536 loops=1)

  • Join Filter: (condachat.condachat_id = refachat.refachat_condachat_id)
  • Rows Removed by Join Filter: 635
8. 4.963 10,578.995 ↓ 9,536.0 9,536 1

Nested Loop Left Join (cost=134,708.78..196,219.77 rows=1 width=167) (actual time=216.129..10,578.995 rows=9,536 loops=1)

9. 6,540.419 10,545.424 ↓ 9,536.0 9,536 1

Nested Loop (cost=134,708.35..196,213.22 rows=1 width=167) (actual time=216.121..10,545.424 rows=9,536 loops=1)

  • Join Filter: (_actuel_profilachat18__.tarifachatactuel_article_id = article.article_id)
  • Rows Removed by Join Filter: 124,913,934
10. 24.174 220.035 ↑ 1.1 9,730 1

Gather Merge (cost=134,459.87..171,663.36 rows=10,841 width=143) (actual time=183.668..220.035 rows=9,730 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
11. 2.089 195.861 ↑ 1.4 3,243 3 / 3

Nested Loop Left Join (cost=133,459.85..169,412.02 rows=4,517 width=143) (actual time=176.156..195.861 rows=3,243 loops=3)

12. 3.362 180.799 ↑ 1.4 3,243 3 / 3

Merge Left Join (cost=133,459.29..133,482.12 rows=4,517 width=135) (actual time=176.127..180.799 rows=3,243 loops=3)

  • Merge Cond: (article.article_id = tarifachatactuel.tarifachatactuel_article_id)
  • Join Filter: (tarifachatactuel.tarifachatactuel_dossier_id = article.article_dossier_id)
13. 1.638 154.687 ↑ 1.4 3,243 3 / 3

Sort (cost=109,273.55..109,284.85 rows=4,517 width=123) (actual time=154.319..154.687 rows=3,243 loops=3)

  • Sort Key: article.article_id
  • Sort Method: quicksort Memory: 1,536kB
14. 0.555 153.049 ↑ 1.4 3,243 3 / 3

Hash Left Join (cost=12,573.43..108,999.35 rows=4,517 width=123) (actual time=125.285..153.049 rows=3,243 loops=3)

  • Hash Cond: (mesure.mesure_unitecontenance_id = _mesure_unitecontenance__.unite_id)
15. 1.111 151.894 ↑ 1.4 3,243 3 / 3

Nested Loop Left Join (cost=12,491.69..108,860.58 rows=4,517 width=119) (actual time=124.669..151.894 rows=3,243 loops=3)

16. 1.302 147.540 ↑ 1.4 3,243 3 / 3

Nested Loop Left Join (cost=12,491.40..107,466.04 rows=4,517 width=119) (actual time=124.654..147.540 rows=3,243 loops=3)

17. 1.570 136.508 ↑ 1.4 3,243 3 / 3

Nested Loop (cost=12,490.97..74,047.99 rows=4,517 width=60) (actual time=124.635..136.508 rows=3,243 loops=3)

18. 2.982 128.451 ↑ 1.4 3,243 3 / 3

Hash Left Join (cost=12,490.54..42,901.38 rows=4,517 width=40) (actual time=124.608..128.451 rows=3,243 loops=3)

  • Hash Cond: (article.article_articleex_id = _article_articleex__.articleex_id)
  • Filter: ((_article_articleex__.articleex_enum1 <> 3) OR (_article_articleex__.articleex_enum1 IS NULL))
  • Rows Removed by Filter: 1,124
19. 1.886 2.143 ↑ 1.1 4,367 3 / 3

Parallel Bitmap Heap Scan on article (cost=368.39..30,705.47 rows=4,876 width=36) (actual time=0.344..2.143 rows=4,367 loops=3)

  • Recheck Cond: ((article_dossier_id = 205) AND (article_etat = 0))
  • Heap Blocks: exact=1,201
20. 0.257 0.257 ↓ 1.1 13,101 1 / 3

Bitmap Index Scan on article_etat_sk (cost=0.00..365.46 rows=11,703 width=0) (actual time=0.771..0.771 rows=13,101 loops=1)

  • Index Cond: ((article_dossier_id = 205) AND (article_etat = 0))
21. 48.332 123.326 ↓ 1.0 324,377 3 / 3

Hash (cost=8,068.18..8,068.18 rows=324,318 width=8) (actual time=123.326..123.326 rows=324,377 loops=3)

  • Buckets: 524,288 Batches: 1 Memory Usage: 15,599kB
22. 74.994 74.994 ↓ 1.0 324,377 3 / 3

Seq Scan on articleex _article_articleex__ (cost=0.00..8,068.18 rows=324,318 width=8) (actual time=0.014..74.994 rows=324,377 loops=3)

23. 6.487 6.487 ↑ 1.0 1 9,730 / 3

Index Scan using produit_pk on produit (cost=0.43..6.90 rows=1 width=24) (actual time=0.002..0.002 rows=1 loops=9,730)

  • Index Cond: (produit_id = article.article_produit_id)
24. 9.730 9.730 ↑ 1.0 1 9,730 / 3

Index Scan using articleden_ak on articleden (cost=0.43..7.39 rows=1 width=63) (actual time=0.003..0.003 rows=1 loops=9,730)

  • Index Cond: (article.article_id = articleden_article_id)
25. 3.243 3.243 ↑ 1.0 1 9,730 / 3

Index Scan using mesure_pk on mesure (cost=0.29..0.31 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=9,730)

  • Index Cond: (mesure_id = produit.produit_mesure_id)
26. 0.215 0.600 ↓ 1.0 2,307 3 / 3

Hash (cost=53.55..53.55 rows=2,255 width=8) (actual time=0.600..0.600 rows=2,307 loops=3)

  • Buckets: 4,096 Batches: 1 Memory Usage: 123kB
27. 0.385 0.385 ↓ 1.0 2,307 3 / 3

Seq Scan on unite _mesure_unitecontenance__ (cost=0.00..53.55 rows=2,255 width=8) (actual time=0.017..0.385 rows=2,307 loops=3)

28. 3.102 22.750 ↓ 291.7 13,125 3 / 3

Sort (cost=24,185.74..24,185.85 rows=45 width=20) (actual time=21.803..22.750 rows=13,125 loops=3)

  • Sort Key: tarifachatactuel.tarifachatactuel_article_id
  • Sort Method: quicksort Memory: 1,410kB
29. 18.159 19.648 ↓ 291.8 13,131 3 / 3

Bitmap Heap Scan on tarifachatactuel (cost=248.06..24,184.50 rows=45 width=20) (actual time=1.988..19.648 rows=13,131 loops=3)

  • Recheck Cond: (tarifachatactuel_dossier_id = 205)
  • Filter: ((tarifachatactuel_profiltarifachat_id IS NULL) AND tarifachatactuel_principal AND (tarifachatactuel_etablissement_id = 344))
  • Rows Removed by Filter: 14,097
  • Heap Blocks: exact=5,385
30. 1.489 1.489 ↓ 3.7 27,228 3 / 3

Bitmap Index Scan on tarifachatactuel_dossier_sk (cost=0.00..248.05 rows=7,416 width=0) (actual time=1.489..1.489 rows=27,228 loops=3)

  • Index Cond: (tarifachatactuel_dossier_id = 205)
31. 12.973 12.973 ↑ 1.0 1 9,730 / 3

Index Scan using tarifventeactuel_ak on tarifventeactuel (cost=0.56..7.94 rows=1 width=16) (actual time=0.004..0.004 rows=1 loops=9,730)

  • Index Cond: ((tarifventeactuel_article_id = article.article_id) AND (tarifventeactuel_dossier_id = article.article_dossier_id) AND (tarifventeactuel_dossier_id = 205) AND (tarifventeactuel_etablissement_id = 344) AND (tarifventeactuel_profiltarif_id IS NULL))
32. 3,754.394 3,784.970 ↓ 12,839.0 12,839 9,730

Materialize (cost=248.48..24,387.24 rows=1 width=36) (actual time=0.000..0.389 rows=12,839 loops=9,730)

33. 4.954 30.576 ↓ 12,839.0 12,839 1

Nested Loop (cost=248.48..24,387.24 rows=1 width=36) (actual time=1.709..30.576 rows=12,839 loops=1)

34. 11.312 12.491 ↓ 547.1 13,131 1

Bitmap Heap Scan on tarifachatactuel _actuel_profilachat18__ (cost=248.06..24,184.50 rows=24 width=28) (actual time=1.698..12.491 rows=13,131 loops=1)

  • Recheck Cond: (tarifachatactuel_dossier_id = 205)
  • Filter: (tarifachatactuel_principal AND (tarifachatactuel_profiltarifachat_id = 18))
  • Rows Removed by Filter: 14,097
  • Heap Blocks: exact=5,385
35. 1.179 1.179 ↓ 3.7 27,228 1

Bitmap Index Scan on tarifachatactuel_dossier_sk (cost=0.00..248.05 rows=7,416 width=0) (actual time=1.179..1.179 rows=27,228 loops=1)

  • Index Cond: (tarifachatactuel_dossier_id = 205)
36. 13.131 13.131 ↑ 1.0 1 13,131

Index Scan using condachat_pk on condachat _actuel_profilachatcondachat18__ (cost=0.43..8.45 rows=1 width=16) (actual time=0.001..0.001 rows=1 loops=13,131)

  • Index Cond: (condachat_id = _actuel_profilachat18__.tarifachatactuel_condachat_id)
  • Filter: (condachat_dossier_id = 205)
37. 28.608 28.608 ↑ 1.0 1 9,536

Index Scan using condachat_ak on condachat (cost=0.43..6.54 rows=1 width=12) (actual time=0.003..0.003 rows=1 loops=9,536)

  • Index Cond: ((condachat_dossier_id = produit.produit_dossier_id) AND (condachat_produit_id = article.article_produit_id))
  • Filter: condachat_principal
  • Rows Removed by Filter: 0
38. 19.072 19.072 ↑ 1.0 1 9,536

Index Scan using refachat_ak on refachat (cost=0.43..6.20 rows=1 width=17) (actual time=0.002..0.002 rows=1 loops=9,536)

  • Index Cond: (refachat_article_id = article.article_id)
  • Filter: ((refachat_dossier_id = 205) AND (refachat_dossier_id = article.article_dossier_id))
39. 19.072 19.072 ↑ 1.0 1 9,536

Index Scan using refachat_pk on refachat _actuel_profilachatrefachat18__ (cost=0.43..8.45 rows=1 width=17) (actual time=0.002..0.002 rows=1 loops=9,536)

  • Index Cond: (_actuel_profilachat18__.tarifachatactuel_refachat_id = refachat_id)
  • Filter: (refachat_dossier_id = 205)
40. 19.072 19.072 ↓ 0.0 0 9,536

Index Scan using fournisseur_pk on fournisseur _actuel_profilachatfournisseur18__ (cost=0.29..0.36 rows=1 width=15) (actual time=0.002..0.002 rows=0 loops=9,536)

  • Index Cond: (fournisseur_id = _actuel_profilachatcondachat18__.condachat_fournisseur_id)
  • Filter: ((fournisseur_dossier_id = 205) AND ((fournisseur_code)::text = 'NAJA'::text))
  • Rows Removed by Filter: 1
41. 0.026 0.026 ↑ 1.0 1 13

Index Scan using profiltaxe_pk on profiltaxe _actuel_profilachatprofiltaxe18__ (cost=0.28..0.30 rows=1 width=22) (actual time=0.002..0.002 rows=1 loops=13)

  • Index Cond: (profiltaxe_id = _actuel_profilachatcondachat18__.condachat_profiltaxe_id)
  • Filter: (profiltaxe_dossier_id = 205)
42. 9.919 34.684 ↓ 8,149.0 8,149 13

Subquery Scan on gtin1 (cost=65,307.92..65,308.92 rows=1 width=21) (actual time=1.588..2.668 rows=8,149 loops=13)

  • Filter: ((gtin1.index = 1) AND (gtin1.gtin_dossier_id = 205))
  • Rows Removed by Filter: 1,013
43. 5.762 24.765 ↓ 160.7 9,162 13

Sort (cost=65,307.92..65,308.07 rows=57 width=33) (actual time=1.588..1.905 rows=9,162 loops=13)

  • Sort Key: gtin.gtin_id
  • Sort Method: quicksort Memory: 1,100kB
44. 2.669 19.003 ↓ 160.7 9,162 1

WindowAgg (cost=65,305.12..65,306.26 rows=57 width=33) (actual time=16.026..19.003 rows=9,162 loops=1)

45. 2.216 16.334 ↓ 160.7 9,162 1

Sort (cost=65,305.12..65,305.26 rows=57 width=25) (actual time=16.022..16.334 rows=9,162 loops=1)

  • Sort Key: gtin.gtin_article_id, gtin.gtin_id
  • Sort Method: quicksort Memory: 1,100kB
46. 4.313 14.118 ↓ 160.7 9,162 1

Hash Join (cost=33,431.31..65,303.46 rows=57 width=25) (actual time=6.319..14.118 rows=9,162 loops=1)

  • Hash Cond: (gtin.gtin_article_id = article_1.article_id)
  • Join Filter: ((gtin.gtin_code)::text <> (article_1.article_gtin)::text)
  • Rows Removed by Join Filter: 13,131
47. 3.687 4.513 ↓ 1.6 22,293 1

Bitmap Heap Scan on gtin (cost=341.18..32,008.90 rows=13,516 width=25) (actual time=1.016..4.513 rows=22,293 loops=1)

  • Recheck Cond: (gtin_dossier_id = 205)
  • Heap Blocks: exact=2,194
48. 0.826 0.826 ↓ 1.6 22,293 1

Bitmap Index Scan on gtin_article_sk (cost=0.00..337.80 rows=13,516 width=0) (actual time=0.826..0.826 rows=22,293 loops=1)

  • Index Cond: (gtin_dossier_id = 205)
49. 1.315 5.292 ↓ 1.0 13,131 1

Hash (cost=32,929.26..32,929.26 rows=12,869 width=21) (actual time=5.292..5.292 rows=13,131 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 847kB
50. 3.508 3.977 ↓ 1.0 13,131 1

Bitmap Heap Scan on article article_1 (cost=372.16..32,929.26 rows=12,869 width=21) (actual time=0.625..3.977 rows=13,131 loops=1)

  • Recheck Cond: (article_dossier_id = 205)
  • Heap Blocks: exact=1,855
51. 0.469 0.469 ↓ 1.0 13,131 1

Bitmap Index Scan on article_etat_sk (cost=0.00..368.95 rows=12,869 width=0) (actual time=0.469..0.469 rows=13,131 loops=1)

  • Index Cond: (article_dossier_id = 205)
Planning time : 21.613 ms