explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bzG4

Settings
# exclusive inclusive rows x rows loops node
1. 0.009 84.465 ↑ 1.0 50 1

Limit (cost=2,659.56..2,659.68 rows=50 width=428) (actual time=84.452..84.465 rows=50 loops=1)

2.          

CTE max_afci

3. 6.068 6.954 ↑ 1.0 11,749 1

HashAggregate (cost=244.79..363.89 rows=11,910 width=8) (actual time=4.283..6.954 rows=11,749 loops=1)

  • Group Key: r8__1.id_pers_morale
4. 0.886 0.886 ↑ 1.0 11,758 1

Seq Scan on r_demande_afci_pers_morale r8__1 (cost=0.00..185.19 rows=11,919 width=8) (actual time=0.017..0.886 rows=11,758 loops=1)

5. 2.477 84.456 ↑ 23.2 50 1

Sort (cost=2,295.67..2,298.57 rows=1,158 width=428) (actual time=84.451..84.456 rows=50 loops=1)

  • Sort Key: t0_.raison_sociale
  • Sort Method: top-N heapsort Memory: 32kB
6. 7.929 81.979 ↓ 10.1 11,750 1

Hash Left Join (cost=1,930.53..2,257.20 rows=1,158 width=428) (actual time=69.559..81.979 rows=11,750 loops=1)

  • Hash Cond: (t1_.statut_courant = t3_.id)
7. 3.569 74.042 ↓ 10.1 11,750 1

Hash Right Join (cost=1,918.05..2,217.23 rows=1,158 width=486) (actual time=69.538..74.042 rows=11,750 loops=1)

  • Hash Cond: (t1_.id_demande_afci = t9_.id)
8. 0.959 0.959 ↑ 1.0 11,750 1

Seq Scan on t_afci t1_ (cost=0.00..243.25 rows=11,825 width=17) (actual time=0.008..0.959 rows=11,750 loops=1)

9. 3.367 69.514 ↓ 10.1 11,750 1

Hash (cost=1,903.58..1,903.58 rows=1,158 width=477) (actual time=69.514..69.514 rows=11,750 loops=1)

  • Buckets: 16384 (originally 2048) Batches: 1 (originally 1) Memory Usage: 1138kB
10. 6.141 66.147 ↓ 10.1 11,750 1

Nested Loop Left Join (cost=1,173.26..1,903.58 rows=1,158 width=477) (actual time=39.057..66.147 rows=11,750 loops=1)

11. 4.108 48.256 ↓ 10.1 11,750 1

Hash Right Join (cost=1,172.98..1,467.42 rows=1,158 width=477) (actual time=39.043..48.256 rows=11,750 loops=1)

  • Hash Cond: (r8_.id_pers_morale = t0_.id)
12. 9.406 9.406 ↑ 1.0 11,749 1

CTE Scan on max_afci r8_ (cost=0.00..238.20 rows=11,910 width=8) (actual time=4.286..9.406 rows=11,749 loops=1)

13. 3.791 34.742 ↓ 10.3 11,750 1

Hash (cost=1,158.69..1,158.69 rows=1,143 width=477) (actual time=34.742..34.742 rows=11,750 loops=1)

  • Buckets: 16384 (originally 2048) Batches: 1 (originally 1) Memory Usage: 1138kB
14. 2.965 30.951 ↓ 10.3 11,750 1

Hash Join (cost=890.54..1,158.69 rows=1,143 width=477) (actual time=19.868..30.951 rows=11,750 loops=1)

  • Hash Cond: (r7_.phy_id = t4_.id)
15. 2.791 27.954 ↓ 10.3 11,750 1

Hash Join (cost=880.09..1,142.81 rows=1,143 width=205) (actual time=19.824..27.954 rows=11,750 loops=1)

  • Hash Cond: (r5_.adr_id = t2_.id)
16. 4.193 25.154 ↓ 5.1 11,750 1

Hash Join (cost=879.03..1,121.75 rows=2,286 width=47) (actual time=19.805..25.154 rows=11,750 loops=1)

  • Hash Cond: (r5_.mrl_id = t0_.id)
17. 1.189 1.189 ↑ 1.0 11,751 1

Seq Scan on r_pers_morale_adresse r5_ (cost=0.00..175.44 rows=11,944 width=8) (actual time=0.009..1.189 rows=11,751 loops=1)

18. 3.309 19.772 ↓ 5.2 11,750 1

Hash (cost=850.91..850.91 rows=2,249 width=43) (actual time=19.771..19.772 rows=11,750 loops=1)

  • Buckets: 16384 (originally 4096) Batches: 1 (originally 1) Memory Usage: 725kB
19. 4.486 16.463 ↓ 5.2 11,750 1

Hash Join (cost=482.32..850.91 rows=2,249 width=43) (actual time=5.285..16.463 rows=11,750 loops=1)

  • Hash Cond: (t0_.parent_id = t6_.id)
20. 6.730 6.730 ↓ 1.0 11,750 1

Seq Scan on t_pers_morale t0_ (cost=0.00..302.26 rows=11,692 width=43) (actual time=0.014..6.730 rows=11,750 loops=1)

  • Filter: ("substring"((num_id_entreprise)::text, 10) <> ''::text)
  • Rows Removed by Filter: 1
21. 0.010 5.247 ↑ 376.7 6 1

Hash (cost=454.07..454.07 rows=2,260 width=12) (actual time=5.246..5.247 rows=6 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 33kB
22. 0.075 5.237 ↑ 376.7 6 1

Hash Join (cost=390.40..454.07 rows=2,260 width=12) (actual time=5.234..5.237 rows=6 loops=1)

  • Hash Cond: (r7_.mrl_id = t6_.id)
23. 0.005 0.005 ↑ 376.7 6 1

Seq Scan on r_pers_morale_pers_physique r7_ (cost=0.00..32.60 rows=2,260 width=8) (actual time=0.003..0.005 rows=6 loops=1)

24. 2.804 5.157 ↑ 1.0 11,751 1

Hash (cost=243.51..243.51 rows=11,751 width=4) (actual time=5.157..5.157 rows=11,751 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 542kB
25. 2.353 2.353 ↑ 1.0 11,751 1

Seq Scan on t_pers_morale t6_ (cost=0.00..243.51 rows=11,751 width=4) (actual time=0.004..2.353 rows=11,751 loops=1)

26. 0.003 0.009 ↓ 1.5 3 1

Hash (cost=1.04..1.04 rows=2 width=166) (actual time=0.009..0.009 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
27. 0.006 0.006 ↓ 1.5 3 1

Seq Scan on t_adresse t2_ (cost=0.00..1.04 rows=2 width=166) (actual time=0.005..0.006 rows=3 loops=1)

  • Filter: est_principale
  • Rows Removed by Filter: 1
28. 0.017 0.032 ↓ 1.5 30 1

Hash (cost=10.20..10.20 rows=20 width=280) (actual time=0.032..0.032 rows=30 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
29. 0.015 0.015 ↓ 1.5 30 1

Seq Scan on t_pers_physique t4_ (cost=0.00..10.20 rows=20 width=280) (actual time=0.009..0.015 rows=30 loops=1)

30. 11.750 11.750 ↑ 1.0 1 11,750

Index Only Scan using t_demande_afci_pkey on t_demande_afci t9_ (cost=0.29..0.37 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=11,750)

  • Index Cond: (id = r8_.id_demande_afci)
  • Heap Fetches: 11748
31. 0.004 0.008 ↑ 8.5 13 1

Hash (cost=11.10..11.10 rows=110 width=142) (actual time=0.008..0.008 rows=13 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
32. 0.004 0.004 ↑ 8.5 13 1

Seq Scan on t_statut_demande t3_ (cost=0.00..11.10 rows=110 width=142) (actual time=0.003..0.004 rows=13 loops=1)

Planning time : 8.596 ms
Execution time : 84.852 ms