explain.depesz.com

PostgreSQL's explain analyze made readable

Result: dWym

Settings
# exclusive inclusive rows x rows loops node
1. 0.069 16.949 ↓ 11.1 278 1

Unique (cost=1,397.90..1,398.34 rows=25 width=68) (actual time=16.869..16.949 rows=278 loops=1)

2. 0.129 16.880 ↓ 11.1 278 1

Sort (cost=1,397.90..1,397.96 rows=25 width=68) (actual time=16.867..16.880 rows=278 loops=1)

  • Sort Key: commandeve0_.datecommandevente, commandeve0_.id, commandeve0_.numerocommandevente, cliententi2_1_.abrege, (min(listeligne1_.datelivraisonacceptee)), commandeve0_2_.reference
  • Sort Method: quicksort Memory: 64kB
3. 0.354 16.751 ↓ 11.1 278 1

HashAggregate (cost=1,397.07..1,397.32 rows=25 width=68) (actual time=16.703..16.751 rows=278 loops=1)

  • Group Key: commandeve0_.datecommandevente, commandeve0_.id, commandeve0_.numerocommandevente, cliententi2_1_.abrege, commandeve0_2_.reference
4. 0.208 16.397 ↓ 18.8 469 1

Nested Loop (cost=835.22..1,396.69 rows=25 width=68) (actual time=7.215..16.397 rows=469 loops=1)

  • Join Filter: ((cliententi2_.id)::text = (cliententi2_1_.id)::text)
5. 0.343 15.251 ↓ 18.8 469 1

Nested Loop (cost=834.95..1,388.31 rows=25 width=117) (actual time=7.203..15.251 rows=469 loops=1)

6. 0.336 14.439 ↓ 18.8 469 1

Nested Loop (cost=834.68..1,380.74 rows=25 width=85) (actual time=7.196..14.439 rows=469 loops=1)

7. 0.435 11.413 ↓ 13.3 1,345 1

Hash Join (cost=834.40..1,329.10 rows=101 width=118) (actual time=6.892..11.413 rows=1,345 loops=1)

  • Hash Cond: ((commandeve0_1_.id_adresseemetteur)::text = (adresseent7_.id)::text)
8. 0.564 10.847 ↓ 1.1 1,345 1

Hash Join (cost=813.06..1,301.97 rows=1,275 width=151) (actual time=6.754..10.847 rows=1,345 loops=1)

  • Hash Cond: ((listeligne1_.id_commandevente)::text = (commandeve0_.id)::text)
9. 1.310 6.085 ↑ 1.0 1,356 1

Hash Join (cost=276.21..747.26 rows=1,363 width=70) (actual time=2.548..6.085 rows=1,356 loops=1)

  • Hash Cond: ((listeligne1_2_.id)::text = (listeligne1_.id)::text)
10. 2.241 2.241 ↓ 1.0 7,093 1

Seq Scan on dm1_lignedocumentcommercial listeligne1_2_ (cost=0.00..430.84 rows=7,089 width=66) (actual time=0.003..2.241 rows=7,093 loops=1)

  • Filter: ((datefinvalidite IS NULL) AND (quantite_valeur > '0'::numeric))
  • Rows Removed by Filter: 903
11. 0.287 2.534 ↑ 1.0 1,482 1

Hash (cost=257.01..257.01 rows=1,536 width=103) (actual time=2.534..2.534 rows=1,482 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 212kB
12. 0.971 2.247 ↑ 1.0 1,482 1

Hash Join (cost=96.82..257.01 rows=1,536 width=103) (actual time=0.929..2.247 rows=1,482 loops=1)

  • Hash Cond: ((listeligne1_1_.id)::text = (listeligne1_.id)::text)
13. 0.354 0.354 ↓ 1.0 5,029 1

Seq Scan on dm2_lignedocumentcommercialvente listeligne1_1_ (cost=0.00..126.06 rows=5,006 width=33) (actual time=0.002..0.354 rows=5,029 loops=1)

14. 0.246 0.922 ↑ 1.0 1,482 1

Hash (cost=77.62..77.62 rows=1,536 width=70) (actual time=0.922..0.922 rows=1,482 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 164kB
15. 0.676 0.676 ↑ 1.0 1,482 1

Seq Scan on dm2_lignecommandevente listeligne1_ (cost=0.00..77.62 rows=1,536 width=70) (actual time=0.003..0.676 rows=1,482 loops=1)

  • Filter: ((NOT etatproduction) AND statutrevue AND ((id)::text !~~ 'DefaultRecord_%'::text) AND ((etatlivraison)::text <> '2'::text))
  • Rows Removed by Filter: 728
16. 0.380 4.198 ↓ 1.0 1,259 1

Hash (cost=521.53..521.53 rows=1,226 width=180) (actual time=4.198..4.198 rows=1,259 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 280kB
17. 1.050 3.818 ↓ 1.0 1,259 1

Hash Join (cost=227.71..521.53 rows=1,226 width=180) (actual time=1.888..3.818 rows=1,259 loops=1)

  • Hash Cond: ((commandeve0_2_.id)::text = (commandeve0_.id)::text)
18. 0.889 0.889 ↓ 1.0 4,726 1

Seq Scan on dm1_documentcommercial commandeve0_2_ (cost=0.00..263.88 rows=4,715 width=36) (actual time=0.001..0.889 rows=4,726 loops=1)

  • Filter: (datefinvalidite IS NULL)
  • Rows Removed by Filter: 273
19. 0.287 1.879 ↓ 1.0 1,298 1

Hash (cost=211.50..211.50 rows=1,297 width=144) (actual time=1.879..1.879 rows=1,298 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 243kB
20. 0.793 1.592 ↓ 1.0 1,298 1

Hash Join (cost=66.70..211.50 rows=1,297 width=144) (actual time=0.571..1.592 rows=1,298 loops=1)

  • Hash Cond: ((commandeve0_1_.id)::text = (commandeve0_.id)::text)
21. 0.237 0.237 ↓ 1.0 3,052 1

Seq Scan on dm2_documentcommercialvente commandeve0_1_ (cost=0.00..120.42 rows=3,042 width=99) (actual time=0.001..0.237 rows=3,052 loops=1)

22. 0.205 0.562 ↓ 1.0 1,298 1

Hash (cost=50.48..50.48 rows=1,297 width=45) (actual time=0.562..0.562 rows=1,298 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 118kB
23. 0.357 0.357 ↓ 1.0 1,298 1

Seq Scan on dm2_commandevente commandeve0_ (cost=0.00..50.48 rows=1,297 width=45) (actual time=0.004..0.357 rows=1,298 loops=1)

  • Filter: (((id)::text !~~ 'DefaultRecord_%'::text) AND (datecommandevente <= '2019-07-03'::date))
  • Rows Removed by Filter: 9
24. 0.004 0.131 ↑ 1.1 29 1

Hash (cost=20.94..20.94 rows=32 width=32) (actual time=0.131..0.131 rows=29 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
25. 0.052 0.127 ↑ 1.1 29 1

Hash Semi Join (cost=5.45..20.94 rows=32 width=32) (actual time=0.048..0.127 rows=29 loops=1)

  • Hash Cond: ((adresseent7_.id_etablissement)::text = (etablissem10_.id)::text)
26. 0.036 0.036 ↑ 1.1 370 1

Seq Scan on dm1_adresse adresseent7_ (cost=0.00..14.07 rows=407 width=44) (actual time=0.003..0.036 rows=370 loops=1)

27. 0.001 0.039 ↑ 1.0 3 1

Hash (cost=5.41..5.41 rows=3 width=22) (actual time=0.039..0.039 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
28. 0.003 0.038 ↑ 1.0 3 1

HashAggregate (cost=5.35..5.38 rows=3 width=22) (actual time=0.037..0.038 rows=3 loops=1)

  • Group Key: etablissem10_.id
29. 0.004 0.035 ↑ 1.0 3 1

Hash Join (cost=1.07..5.34 rows=3 width=22) (actual time=0.026..0.035 rows=3 loops=1)

  • Hash Cond: ((listeetabl9_.id_etablissement)::text = (etablissem10_.id)::text)
30. 0.002 0.026 ↑ 1.0 3 1

Nested Loop (cost=0.00..4.23 rows=3 width=19) (actual time=0.017..0.026 rows=3 loops=1)

31. 0.013 0.013 ↑ 1.0 1 1

Seq Scan on dm1_utilisateur utilisateu8_ (cost=0.00..2.46 rows=1 width=30) (actual time=0.012..0.013 rows=1 loops=1)

  • Filter: (((id)::text = '402881973205e5cc013205f2cdbf0036'::text) AND (dtype = 'N'::bpchar))
  • Rows Removed by Filter: 30
32. 0.011 0.011 ↑ 1.0 3 1

Seq Scan on dm1_utilisateur_etablissement listeetabl9_ (cost=0.00..1.74 rows=3 width=49) (actual time=0.003..0.011 rows=3 loops=1)

  • Filter: ((id_utilisateur)::text = '402881973205e5cc013205f2cdbf0036'::text)
  • Rows Removed by Filter: 56
33. 0.002 0.005 ↑ 1.0 3 1

Hash (cost=1.03..1.03 rows=3 width=22) (actual time=0.005..0.005 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
34. 0.003 0.003 ↑ 1.0 3 1

Seq Scan on dm1_etablissement etablissem10_ (cost=0.00..1.03 rows=3 width=22) (actual time=0.001..0.003 rows=3 loops=1)

35. 2.690 2.690 ↓ 0.0 0 1,345

Index Scan using dm1_article_pkey on dm1_article articleent3_ (cost=0.28..0.50 rows=1 width=32) (actual time=0.002..0.002 rows=0 loops=1,345)

  • Index Cond: ((id)::text = (listeligne1_2_.id_article)::text)
  • Filter: (((typearticle)::text <> '4'::text) AND ((origine)::text = '2'::text) AND ((strategieproduction)::text = '2'::text))
  • Rows Removed by Filter: 0
36. 0.469 0.469 ↑ 1.0 1 469

Index Only Scan using dm2_client_pkey on dm2_client cliententi2_ (cost=0.27..0.29 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=469)

  • Index Cond: (id = (commandeve0_1_.id_client)::text)
  • Heap Fetches: 84
37. 0.938 0.938 ↑ 1.0 1 469

Index Scan using dm1_tiers_pkey on dm1_tiers cliententi2_1_ (cost=0.27..0.32 rows=1 width=48) (actual time=0.002..0.002 rows=1 loops=469)

  • Index Cond: ((id)::text = (commandeve0_1_.id_client)::text)
  • Filter: ((statutcomptable)::text <> '2'::text)
Planning time : 5.810 ms
Execution time : 17.189 ms