explain.depesz.com

A tool for finding a real cause for slow queries.

Result: uvB

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 198.868 11554.292 ↓ 15.7 114657 1

Unique (cost=134095.32..135099.07 rows=7300 width=271) (actual time=11252.515..11554.292 rows=114657 loops=1)

2. 526.060 11355.424 ↓ 15.7 114657 1

Sort (cost=134095.32..134113.57 rows=7300 width=271) (actual time=11252.511..11355.424 rows=114657 loops=1)

  • Sort Key: personnes.id, dossiers.numdemrsa, dossiers.matricule, dossiers.numorgcedmut, dossiers.ddarrmut, situationsdossiersrsa.etatdosrsa, detailsdroitsrsa.topsansdomfixe, calculsdroitsrsa.toppersdrodevorsa, prestations.rolepers, (dbconcat((detailscalculsdroitsrsa.natpf)::text)), public.orientsstructs.propo_algo, public.orientsstructs.statut_orient, personnes.qual, personnes.nom, personnes.prenom, personnes.dtnai, dossiers.dtdemrsa, personnes.nir, personnes.idassedic, adresses.codepos, adresses.locaadr, foyers.sitfam, detailsdroitsrsa.nbenfautcha, dsps.id, dsps.personne_id, dsps.topdrorsarmiant, dsps.drorsarmianta2, dsps.sitpersdemrsa, dsps.topisogroouenf, dsps.topcouvsoc, dsps.accosocfam, dsps.accosocindi, dsps.soutdemarsoc, dsps.nivetu, dsps.nivdipmaxobt, dsps.annobtnivdipmax, dsps.topcompeextrapro, dsps.topengdemarechemploi, dsps.hispro, dsps.duractdomi, dsps.cessderact, dsps.topdomideract, dsps.inscdememploi, dsps.topisogrorechemploi, dsps.accoemploi, dsps.topprojpro, dsps.topcreareprientre, dsps.concoformqualiemploi, dsps.topmoyloco, dsps.toppermicondub, dsps.topautrpermicondu, dsps.natlog, dsps.demarlog, dsps.statutoccupation
  • Sort Method: external merge Disk: 19192kB
3. 2309.107 10829.364 ↓ 15.7 114657 1

HashAggregate (cost=133517.39..133626.89 rows=7300 width=271) (actual time=10515.462..10829.364 rows=114657 loops=1)

4. 184.111 8520.257 ↓ 17.0 123963 1

Nested Loop Left Join (cost=119460.67..132531.89 rows=7300 width=271) (actual time=6932.912..8520.257 rows=123963 loops=1)

5. 913.568 7964.296 ↓ 17.0 123950 1

Hash Join (cost=119460.67..130405.43 rows=7300 width=146) (actual time=6932.838..7964.296 rows=123950 loops=1)

  • Hash Cond: (prestations.personne_id = personnes.id)
6. 119.850 164.069 ↓ 1.1 275314 1

Bitmap Heap Scan on prestations (cost=3945.59..13880.40 rows=249854 width=8) (actual time=45.298..164.069 rows=275314 loops=1)

  • Recheck Cond: ((natprest = 'RSA'::bpchar) AND (rolepers = ANY ('{DEM,CJT}'::bpchar[])))
7. 44.219 44.219 ↓ 1.1 275314 1

Bitmap Index Scan on prestations_allocataire_rsa_idx (cost=0.00..3883.12 rows=249854 width=0) (actual time=44.219..44.219 rows=275314 loops=1)

  • Index Cond: (natprest = 'RSA'::bpchar)
8. 310.852 6886.659 ↓ 7.4 132898 1

Hash (cost=115289.19..115289.19 rows=18072 width=150) (actual time=6886.659..6886.659 rows=132898 loops=1)

9. 690.611 6575.807 ↓ 7.4 132898 1

Hash Join (cost=109172.57..115289.19 rows=18072 width=150) (actual time=5787.493..6575.807 rows=132898 loops=1)

  • Hash Cond: (calculsdroitsrsa.personne_id = personnes.id)
10. 97.824 97.824 ↑ 1.0 292429 1

Seq Scan on calculsdroitsrsa (cost=0.00..4839.29 rows=292429 width=8) (actual time=0.015..97.824 rows=292429 loops=1)

11. 310.162 5787.372 ↓ 3.8 135800 1

Hash (cost=108727.85..108727.85 rows=35577 width=142) (actual time=5787.372..5787.372 rows=135800 loops=1)

12. 752.244 5477.210 ↓ 3.8 135800 1

Hash Join (cost=65691.88..108727.85 rows=35577 width=142) (actual time=3431.841..5477.210 rows=135800 loops=1)

  • Hash Cond: (personnes.id = public.orientsstructs.personne_id)
13. 259.435 3506.763 ↓ 1.9 262586 1

Nested Loop (cost=40602.79..81377.60 rows=138574 width=122) (actual time=2213.594..3506.763 rows=262586 loops=1)

14. 198.314 2663.042 ↓ 2.0 97381 1

Merge Join (cost=40602.79..52099.93 rows=48630 width=80) (actual time=2213.547..2663.042 rows=97381 loops=1)

  • Merge Cond: (adresses.id = adressesfoyers.adresse_id)
15. 178.957 178.957 ↑ 1.0 304881 1

Index Scan using adresses_pkey on adresses (cost=0.00..10001.76 rows=304881 width=21) (actual time=0.038..178.957 rows=304881 loops=1)

16. 322.936 2285.771 ↓ 2.0 97381 1

Sort (cost=40600.14..40724.95 rows=49925 width=67) (actual time=2213.493..2285.771 rows=97381 loops=1)

  • Sort Key: adressesfoyers.adresse_id
  • Sort Method: external sort Disk: 7768kB
17. 298.241 1962.835 ↓ 2.0 97381 1

Hash Join (cost=28340.12..36704.12 rows=49925 width=67) (actual time=1535.345..1962.835 rows=97381 loops=1)

  • Hash Cond: (adressesfoyers.foyer_id = foyers.id)
18. 129.435 129.435 ↓ 1.0 202023 1

Seq Scan on adressesfoyers (cost=0.00..6855.18 rows=201915 width=8) (actual time=0.023..129.435 rows=202023 loops=1)

  • Filter: (rgadr = '01'::bpchar)
19. 118.411 1535.159 ↓ 1.9 97378 1

Hash (cost=27715.74..27715.74 rows=49951 width=59) (actual time=1535.159..1535.159 rows=97378 loops=1)

20. 297.876 1416.748 ↓ 1.9 97378 1

Hash Join (cost=21352.27..27715.74 rows=49951 width=59) (actual time=1051.380..1416.748 rows=97378 loops=1)

  • Hash Cond: (dossiers.id = detailsdroitsrsa.dossier_id)
21. 67.686 67.686 ↑ 1.0 202021 1

Seq Scan on dossiers (cost=0.00..4595.21 rows=202021 width=44) (actual time=0.049..67.686 rows=202021 loops=1)

22. 84.178 1051.186 ↓ 1.9 97378 1

Hash (cost=20720.23..20720.23 rows=50563 width=31) (actual time=1051.186..1051.186 rows=97378 loops=1)

23. 278.752 967.008 ↓ 1.9 97378 1

Hash Join (cost=15832.27..20720.23 rows=50563 width=31) (actual time=631.040..967.008 rows=97378 loops=1)

  • Hash Cond: (foyers.dossier_id = detailsdroitsrsa.dossier_id)
24. 57.379 57.379 ↑ 1.0 202022 1

Seq Scan on foyers (cost=0.00..3372.22 rows=202022 width=12) (actual time=0.030..57.379 rows=202022 loops=1)

25. 74.699 630.877 ↓ 1.9 97377 1

Hash (cost=15200.23..15200.23 rows=50563 width=19) (actual time=630.877..630.877 rows=97377 loops=1)

26. 141.449 556.178 ↓ 1.9 97377 1

Hash Join (cost=11812.05..15200.23 rows=50563 width=19) (actual time=378.277..556.178 rows=97377 loops=1)

  • Hash Cond: (detailscalculsdroitsrsa.detaildroitrsa_id = detailsdroitsrsa.id)
27. 36.743 36.743 ↑ 1.0 118926 1

Seq Scan on detailscalculsdroitsrsa (cost=0.00..2139.26 rows=118926 width=8) (actual time=0.015..36.743 rows=118926 loops=1)

28. 68.039 377.986 ↓ 1.1 92253 1

Hash (cost=10751.39..10751.39 rows=84853 width=19) (actual time=377.986..377.986 rows=92253 loops=1)

29. 153.108 309.947 ↓ 1.1 92253 1

Hash Join (cost=4271.75..10751.39 rows=84853 width=19) (actual time=93.844..309.947 rows=92253 loops=1)

  • Hash Cond: (detailsdroitsrsa.dossier_id = situationsdossiersrsa.dossier_id)
30. 63.261 63.261 ↑ 1.0 199579 1

Seq Scan on detailsdroitsrsa (cost=0.00..3884.79 rows=199579 width=13) (actual time=0.017..63.261 rows=199579 loops=1)

31. 45.730 93.578 ↓ 1.1 92253 1

Hash (cost=3211.09..3211.09 rows=84853 width=6) (actual time=93.578..93.578 rows=92253 loops=1)

32. 34.696 47.848 ↓ 1.1 92253 1

Bitmap Heap Scan on situationsdossiersrsa (cost=970.36..3211.09 rows=84853 width=6) (actual time=13.306..47.848 rows=92253 loops=1)

  • Recheck Cond: (etatdosrsa = ANY ('{2,3,4}'::bpchar[]))
33. 13.152 13.152 ↓ 1.1 92253 1

Bitmap Index Scan on situationsdossiersrsa_etatdosrsa_idx (cost=0.00..949.15 rows=84853 width=0) (actual time=13.152..13.152 rows=92253 loops=1)

  • Index Cond: (etatdosrsa = ANY ('{2,3,4}'::bpchar[]))
34. 584.286 584.286 ↑ 2.7 3 97381

Index Scan using personnes_foyer_id_idx on personnes (cost=0.00..0.50 rows=8 width=54) (actual time=0.004..0.006 rows=3 loops=97381)

  • Index Cond: (personnes.foyer_id = adressesfoyers.foyer_id)
35. 192.558 1218.203 ↓ 2.0 295331 1

Hash (cost=23241.64..23241.64 rows=147796 width=20) (actual time=1218.203..1218.203 rows=295331 loops=1)

36. 584.483 1025.645 ↓ 2.0 295331 1

Seq Scan on orientsstructs (cost=16418.76..23241.64 rows=147796 width=20) (actual time=686.151..1025.645 rows=295331 loops=1)

  • Filter: (hashed subplan)
37.          

SubPlan (forSeq Scan)

38. 210.302 441.162 ↑ 1.0 295331 1

GroupAggregate (cost=0.00..15679.78 rows=295592 width=8) (actual time=0.053..441.162 rows=295331 loops=1)

39. 230.860 230.860 ↑ 1.0 295592 1

Index Scan using orientsstructs_personne_id_idx on orientsstructs (cost=0.00..10506.92 rows=295592 width=8) (actual time=0.037..230.860 rows=295592 loops=1)

40. 371.850 371.850 ↓ 0.0 0 123950

Index Scan using dsps_personne_id_idx on dsps (cost=0.00..0.28 rows=1 width=125) (actual time=0.003..0.003 rows=0 loops=123950)

  • Index Cond: (dsps.personne_id = personnes.id)