explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PIkg

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Sort (cost=9,600,439.60..9,600,439.63 rows=11 width=366) (actual rows= loops=)

  • Sort Key: bov.danais, bov.copaip, bov.nunati
2. 0.000 0.000 ↓ 0.0

HashAggregate (cost=9,600,439.30..9,600,439.41 rows=11 width=366) (actual rows= loops=)

  • Group Key: bov.copaip, bov.nunati, bov.nobovi, bov.sexbov, ip.copach, ip.cheipg, bov.indite, (CASE WHEN ((bo.cofgmu IS NOT NULL) AND (bo.cofgmu = '2'::bpchar)) THEN 'O'::text ELSE 'N'::text END), bov.danais, bov.ponais, bov.toupoi, fgder.dafige, fgavder.dafige, bof_mere.ravela, bov.conais, (CASE WHEN (bovige_anim.nunati IS NOT NULL) THEN bovige_anim.copape ELSE bov.copapi END), (CASE WHEN (bovige_anim.nunati IS NOT NULL) THEN bovige_anim.nupere ELSE bov.nupeip END), (CASE WHEN (bovige_anim.nunati IS NOT NULL) THEN bov_pere1.nobovi ELSE bov_pere2.nobovi END), boa.nocomp, bop120.poagty, bop210.poagty
3. 0.000 0.000 ↓ 0.0

Append (cost=3,177,228.08..9,600,438.72 rows=11 width=366) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,177,228.08..4,800,380.88 rows=10 width=213) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,177,227.52..4,800,332.51 rows=10 width=140) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,177,226.95..4,800,284.17 rows=10 width=136) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,177,226.38..4,800,256.07 rows=10 width=150) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,177,225.81..4,800,228.05 rows=10 width=139) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,177,225.25..4,800,204.78 rows=10 width=130) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,177,224.68..4,800,176.88 rows=10 width=144) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,177,224.11..4,800,148.88 rows=10 width=97) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=3,177,223.69..4,800,127.07 rows=10 width=119) (actual rows= loops=)

  • Merge Cond: ((bov.copaip = boapco.copaip) AND (bov.nunati = boapco.nunati))
  • Join Filter: (boapco.cosu = bov.cosu)
13. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,177,223.26..4,716,965.80 rows=10 width=95) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,177,222.69..4,716,941.94 rows=10 width=101) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,177,222.13..4,716,898.78 rows=10 width=99) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=3,177,221.57..4,716,855.62 rows=10 width=97) (actual rows= loops=)

  • Merge Cond: ((bov.copaip = ipgmou.copaip) AND (bov.nunati = ipgmou.nunati))
  • Join Filter: (bov.cosu = ipgmou.cosu)
17. 0.000 0.000 ↓ 0.0

Sort (cost=15.47..15.49 rows=10 width=75) (actual rows= loops=)

  • Sort Key: bov.copaip, bov.nunati
18. 0.000 0.000 ↓ 0.0

Index Scan using bovide_fk3 on bovide bov (cost=0.57..15.30 rows=10 width=75) (actual rows= loops=)

  • Index Cond: ((numeip = '5694030194 '::bpchar) AND (copami = 'FR'::bpchar))
  • Filter: (((indite IS NULL) OR (indite <> 'O'::bpchar)) AND (cosu = '0'::bpchar))
19. 0.000 0.000 ↓ 0.0

Materialize (cost=3,177,206.10..4,704,735.33 rows=2,420,948 width=22) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Finalize GroupAggregate (cost=3,177,206.10..4,674,473.48 rows=2,420,948 width=26) (actual rows= loops=)

  • Group Key: ipgmou.copaip, ipgmou.nunati, ipgmou.cosu, ipgmou.dasort
  • Filter: (max(ipgmou.daench) < CURRENT_DATE)
21. 0.000 0.000 ↓ 0.0

Gather Merge (cost=3,177,206.10..4,417,162.88 rows=9,891,196 width=26) (actual rows= loops=)

  • Workers Planned: 4
22. 0.000 0.000 ↓ 0.0

Partial GroupAggregate (cost=3,176,206.04..3,238,026.02 rows=2,472,799 width=26) (actual rows= loops=)

  • Group Key: ipgmou.copaip, ipgmou.nunati, ipgmou.cosu, ipgmou.dasort
23. 0.000 0.000 ↓ 0.0

Sort (cost=3,176,206.04..3,182,388.04 rows=2,472,799 width=26) (actual rows= loops=)

  • Sort Key: ipgmou.copaip, ipgmou.nunati, ipgmou.dasort
24. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on ipgmou (cost=0.00..2,913,623.06 rows=2,472,799 width=26) (actual rows= loops=)

  • Filter: ((cosu = '0'::bpchar) AND ((dasort IS NULL) OR (dasort > CURRENT_DATE)))
25. 0.000 0.000 ↓ 0.0

Index Scan using bopoat_pk on bopoat bop120 (cost=0.56..4.28 rows=4 width=20) (actual rows= loops=)

  • Index Cond: ((copaip = bov.copaip) AND (nunati = bov.nunati) AND (copoat = '04'::bpchar))
  • Filter: ((cosu = '0'::bpchar) AND (cosu = bov.cosu))
26. 0.000 0.000 ↓ 0.0

Index Scan using bopoat_pk on bopoat bop210 (cost=0.56..4.28 rows=4 width=20) (actual rows= loops=)

  • Index Cond: ((copaip = bov.copaip) AND (nunati = bov.nunati) AND (copoat = '07'::bpchar))
  • Filter: ((cosu = '0'::bpchar) AND (cosu = bov.cosu))
27. 0.000 0.000 ↓ 0.0

Index Scan using ipgmou_pkey on ipgmou ip (cost=0.57..2.38 rows=1 width=38) (actual rows= loops=)

  • Index Cond: ((copaip = ipgmou.copaip) AND (nunati = ipgmou.nunati) AND (daench = (max(ipgmou.daench))))
  • Filter: ((cosu = '0'::bpchar) AND (cosu = ipgmou.cosu))
28. 0.000 0.000 ↓ 0.0

Materialize (cost=0.43..78,873.70 rows=857,501 width=24) (actual rows= loops=)

29. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=0.43..68,154.94 rows=857,501 width=24) (actual rows= loops=)

  • Group Key: boapco.copaip, boapco.nunati, boapco.tyapco, boapco.cosu
30. 0.000 0.000 ↓ 0.0

Index Scan using boapco_pk on boapco (cost=0.43..46,739.53 rows=1,027,232 width=24) (actual rows= loops=)

  • Index Cond: (tyapco = 'A'::bpchar)
  • Filter: (cosu = '0'::bpchar)
31. 0.000 0.000 ↓ 0.0

Index Scan using boapco_pk on boapco boa (cost=0.43..2.17 rows=1 width=26) (actual rows= loops=)

  • Index Cond: ((copaip = boapco.copaip) AND (nunati = boapco.nunati) AND (daapco = (max(boapco.daapco))) AND (tyapco = boapco.tyapco) AND (tyapco = 'A'::bpchar))
  • Filter: ((cosu = '0'::bpchar) AND (boapco.cosu = cosu))
32. 0.000 0.000 ↓ 0.0

Index Scan using bovige_pk on bovige bovige_anim (cost=0.56..2.79 rows=1 width=50) (actual rows= loops=)

  • Index Cond: ((copaip = bov.copaip) AND (nunati = bov.nunati))
  • Filter: ((cosu = '0'::bpchar) AND (bov.cosu = cosu))
33. 0.000 0.000 ↓ 0.0

Index Scan using bofige_pkey on bofige bo (cost=0.57..2.79 rows=1 width=22) (actual rows= loops=)

  • Index Cond: ((copaip = bovige_anim.copame) AND (nunati = bovige_anim.numere) AND (dafige = bov.danais))
34. 0.000 0.000 ↓ 0.0

Index Scan using bovide_pkey on bovide bov_pere1 (cost=0.57..2.32 rows=1 width=29) (actual rows= loops=)

  • Index Cond: ((copaip = bovige_anim.copape) AND (nunati = bovige_anim.nupere))
  • Filter: ((cosu = '0'::bpchar) AND (cosu = bovige_anim.cosu))
35. 0.000 0.000 ↓ 0.0

Index Scan using bovide_pkey on bovide bov_pere2 (cost=0.57..2.79 rows=1 width=29) (actual rows= loops=)

  • Index Cond: ((copaip = bov.copapi) AND (nunati = bov.nupeip))
  • Filter: ((cosu = '0'::bpchar) AND (bov.cosu = cosu))
36. 0.000 0.000 ↓ 0.0

Index Scan using bofige_pkey on bofige bof_mere (cost=0.57..2.80 rows=1 width=24) (actual rows= loops=)

  • Index Cond: ((copaip = bov.copami) AND (copaip = 'FR'::bpchar) AND (nunati = bov.numeip) AND (nunati = '5694030194 '::bpchar) AND (dafige = bov.danais))
  • Filter: ((cosu = '0'::bpchar) AND (bov.cosu = cosu))
37. 0.000 0.000 ↓ 0.0

Index Scan using bofige_pkey on bofige fgder (cost=0.57..4.82 rows=1 width=22) (actual rows= loops=)

  • Index Cond: ((copaip = bov.copaip) AND (copaip = 'FR'::bpchar) AND (nunati = bov.nunati) AND (nunati = '5694030194 '::bpchar))
  • Filter: ((cosu = '0'::bpchar) AND (cosu = bov.cosu) AND (dafige = (SubPlan 2)))
38.          

SubPlan (for Index Scan)

39. 0.000 0.000 ↓ 0.0

Result (cost=2.01..2.02 rows=1 width=4) (actual rows= loops=)

40.          

Initplan (for Result)

41. 0.000 0.000 ↓ 0.0

Limit (cost=0.57..2.01 rows=1 width=4) (actual rows= loops=)

42. 0.000 0.000 ↓ 0.0

Index Scan Backward using bofige_pkey on bofige bfder (cost=0.57..6.35 rows=4 width=4) (actual rows= loops=)

  • Index Cond: ((copaip = fgder.copaip) AND (nunati = fgder.nunati) AND (dafige IS NOT NULL))
  • Filter: (cosu = fgder.cosu)
43. 0.000 0.000 ↓ 0.0

Index Scan using bofige_pkey on bofige fgavder (cost=0.57..4.82 rows=1 width=22) (actual rows= loops=)

  • Index Cond: ((copaip = bov.copaip) AND (copaip = 'FR'::bpchar) AND (nunati = bov.nunati) AND (nunati = '5694030194 '::bpchar))
  • Filter: ((cosu = '0'::bpchar) AND (cosu = bov.cosu) AND (dafige = (SubPlan 4)))
44.          

SubPlan (for Index Scan)

45. 0.000 0.000 ↓ 0.0

Result (cost=2.01..2.02 rows=1 width=4) (actual rows= loops=)

46.          

Initplan (for Result)

47. 0.000 0.000 ↓ 0.0

Limit (cost=0.57..2.01 rows=1 width=4) (actual rows= loops=)

48. 0.000 0.000 ↓ 0.0

Index Scan Backward using bofige_pkey on bofige bfavder (cost=0.57..6.35 rows=4 width=4) (actual rows= loops=)

  • Index Cond: ((copaip = fgavder.copaip) AND (nunati = fgavder.nunati) AND (dafige IS NOT NULL))
  • Filter: (cosu = fgavder.cosu)
49. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,177,237.44..4,800,057.68 rows=1 width=213) (actual rows= loops=)

50. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,177,236.87..4,800,053.16 rows=1 width=130) (actual rows= loops=)

51. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,177,236.31..4,800,048.64 rows=1 width=126) (actual rows= loops=)

52. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,177,235.74..4,800,046.16 rows=1 width=140) (actual rows= loops=)

53. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,177,235.17..4,800,043.62 rows=1 width=129) (actual rows= loops=)

54. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,177,234.60..4,800,040.82 rows=1 width=117) (actual rows= loops=)

  • Join Filter: ((bovige_anim_1.copame = bo_1.copaip) AND (bovige_anim_1.numere = bo_1.nunati))
55. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,177,234.04..4,800,038.33 rows=1 width=131) (actual rows= loops=)

56. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=3,177,233.61..4,800,036.15 rows=1 width=153) (actual rows= loops=)

  • Merge Cond: ((bov_1.copaip = boapco_1.copaip) AND (bov_1.nunati = boapco_1.nunati))
  • Join Filter: (boapco_1.cosu = bov_1.cosu)
57. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,177,233.18..4,716,874.93 rows=1 width=129) (actual rows= loops=)

58. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,177,232.61..4,716,872.54 rows=1 width=135) (actual rows= loops=)

59. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,177,232.05..4,716,869.01 rows=1 width=133) (actual rows= loops=)

60. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=3,177,231.49..4,716,865.48 rows=1 width=131) (actual rows= loops=)

  • Merge Cond: ((bov_1.copaip = ipgmou_1.copaip) AND (bov_1.nunati = ipgmou_1.nunati))
  • Join Filter: (bov_1.cosu = ipgmou_1.cosu)
61. 0.000 0.000 ↓ 0.0

Sort (cost=25.39..25.39 rows=1 width=109) (actual rows= loops=)

  • Sort Key: bov_1.copaip, bov_1.nunati
62. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.13..25.38 rows=1 width=109) (actual rows= loops=)

63. 0.000 0.000 ↓ 0.0

Index Scan using bovige_fk1 on bovige bovige_anim_1 (cost=0.56..5.83 rows=7 width=50) (actual rows= loops=)

  • Index Cond: ((copame = 'FR'::bpchar) AND (numere = '5694030194 '::bpchar))
  • Filter: (cosu = '0'::bpchar)
64. 0.000 0.000 ↓ 0.0

Index Scan using bovide_pkey on bovide bov_1 (cost=0.57..2.79 rows=1 width=75) (actual rows= loops=)

  • Index Cond: ((copaip = bovige_anim_1.copaip) AND (nunati = bovige_anim_1.nunati))
  • Filter: ((cosu = '0'::bpchar) AND (indite = 'O'::bpchar))
65. 0.000 0.000 ↓ 0.0

Materialize (cost=3,177,206.10..4,704,735.33 rows=2,420,948 width=22) (actual rows= loops=)

66. 0.000 0.000 ↓ 0.0

Finalize GroupAggregate (cost=3,177,206.10..4,674,473.48 rows=2,420,948 width=26) (actual rows= loops=)

  • Group Key: ipgmou_1.copaip, ipgmou_1.nunati, ipgmou_1.cosu, ipgmou_1.dasort
  • Filter: (max(ipgmou_1.daench) < CURRENT_DATE)
67. 0.000 0.000 ↓ 0.0

Gather Merge (cost=3,177,206.10..4,417,162.88 rows=9,891,196 width=26) (actual rows= loops=)

  • Workers Planned: 4
68. 0.000 0.000 ↓ 0.0

Partial GroupAggregate (cost=3,176,206.04..3,238,026.02 rows=2,472,799 width=26) (actual rows= loops=)

  • Group Key: ipgmou_1.copaip, ipgmou_1.nunati, ipgmou_1.cosu, ipgmou_1.dasort
69. 0.000 0.000 ↓ 0.0

Sort (cost=3,176,206.04..3,182,388.04 rows=2,472,799 width=26) (actual rows= loops=)

  • Sort Key: ipgmou_1.copaip, ipgmou_1.nunati, ipgmou_1.dasort
70. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on ipgmou ipgmou_1 (cost=0.00..2,913,623.06 rows=2,472,799 width=26) (actual rows= loops=)

  • Filter: ((cosu = '0'::bpchar) AND ((dasort IS NULL) OR (dasort > CURRENT_DATE)))
71. 0.000 0.000 ↓ 0.0

Index Scan using bopoat_pk on bopoat bop120_1 (cost=0.56..3.49 rows=4 width=20) (actual rows= loops=)

  • Index Cond: ((copaip = bov_1.copaip) AND (nunati = bov_1.nunati) AND (copoat = '04'::bpchar))
  • Filter: ((cosu = '0'::bpchar) AND (cosu = bov_1.cosu))
72. 0.000 0.000 ↓ 0.0

Index Scan using bopoat_pk on bopoat bop210_1 (cost=0.56..3.49 rows=4 width=20) (actual rows= loops=)

  • Index Cond: ((copaip = bov_1.copaip) AND (nunati = bov_1.nunati) AND (copoat = '07'::bpchar))
  • Filter: ((cosu = '0'::bpchar) AND (cosu = bov_1.cosu))
73. 0.000 0.000 ↓ 0.0

Index Scan using ipgmou_pkey on ipgmou ip_1 (cost=0.57..2.38 rows=1 width=38) (actual rows= loops=)

  • Index Cond: ((copaip = ipgmou_1.copaip) AND (nunati = ipgmou_1.nunati) AND (daench = (max(ipgmou_1.daench))))
  • Filter: ((cosu = '0'::bpchar) AND (cosu = ipgmou_1.cosu))
74. 0.000 0.000 ↓ 0.0

Materialize (cost=0.43..78,873.70 rows=857,501 width=24) (actual rows= loops=)

75. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=0.43..68,154.94 rows=857,501 width=24) (actual rows= loops=)

  • Group Key: boapco_1.copaip, boapco_1.nunati, boapco_1.tyapco, boapco_1.cosu
76. 0.000 0.000 ↓ 0.0

Index Scan using boapco_pk on boapco boapco_1 (cost=0.43..46,739.53 rows=1,027,232 width=24) (actual rows= loops=)

  • Index Cond: (tyapco = 'A'::bpchar)
  • Filter: (cosu = '0'::bpchar)
77. 0.000 0.000 ↓ 0.0

Index Scan using boapco_pk on boapco boa_1 (cost=0.43..2.17 rows=1 width=26) (actual rows= loops=)

  • Index Cond: ((copaip = boapco_1.copaip) AND (nunati = boapco_1.nunati) AND (daapco = (max(boapco_1.daapco))) AND (tyapco = boapco_1.tyapco) AND (tyapco = 'A'::bpchar))
  • Filter: ((cosu = '0'::bpchar) AND (boapco_1.cosu = cosu))
78. 0.000 0.000 ↓ 0.0

Index Scan using bofige_pkey on bofige bo_1 (cost=0.57..2.47 rows=1 width=22) (actual rows= loops=)

  • Index Cond: ((copaip = 'FR'::bpchar) AND (nunati = '5694030194 '::bpchar) AND (dafige = bov_1.danais))
79. 0.000 0.000 ↓ 0.0

Index Scan using bovide_pkey on bovide bov_pere1_1 (cost=0.57..2.79 rows=1 width=29) (actual rows= loops=)

  • Index Cond: ((copaip = bovige_anim_1.copape) AND (nunati = bovige_anim_1.nupere))
  • Filter: ((cosu = '0'::bpchar) AND (cosu = bovige_anim_1.cosu))
80. 0.000 0.000 ↓ 0.0

Index Scan using bovide_pkey on bovide bov_pere2_1 (cost=0.57..2.53 rows=1 width=29) (actual rows= loops=)

  • Index Cond: ((copaip = bov_1.copapi) AND (nunati = bov_1.nupeip))
  • Filter: ((cosu = '0'::bpchar) AND (bov_1.cosu = cosu))
81. 0.000 0.000 ↓ 0.0

Index Scan using bofige_pkey on bofige bof_mere_1 (cost=0.57..2.48 rows=1 width=24) (actual rows= loops=)

  • Index Cond: ((copaip = bov_1.copami) AND (nunati = bov_1.numeip) AND (dafige = bov_1.danais))
  • Filter: ((cosu = '0'::bpchar) AND (bov_1.cosu = cosu))
82. 0.000 0.000 ↓ 0.0

Index Scan using bofige_pkey on bofige fgder_1 (cost=0.57..4.50 rows=1 width=22) (actual rows= loops=)

  • Index Cond: ((copaip = bov_1.copaip) AND (copaip = 'FR'::bpchar) AND (nunati = bov_1.nunati) AND (nunati = '5694030194 '::bpchar))
  • Filter: ((cosu = '0'::bpchar) AND (cosu = bov_1.cosu) AND (dafige = (SubPlan 6)))
83.          

SubPlan (for Index Scan)

84. 0.000 0.000 ↓ 0.0

Result (cost=2.01..2.02 rows=1 width=4) (actual rows= loops=)

85.          

Initplan (for Result)

86. 0.000 0.000 ↓ 0.0

Limit (cost=0.57..2.01 rows=1 width=4) (actual rows= loops=)

87. 0.000 0.000 ↓ 0.0

Index Scan Backward using bofige_pkey on bofige bfder_1 (cost=0.57..6.35 rows=4 width=4) (actual rows= loops=)

  • Index Cond: ((copaip = fgder_1.copaip) AND (nunati = fgder_1.nunati) AND (dafige IS NOT NULL))
  • Filter: (cosu = fgder_1.cosu)
88. 0.000 0.000 ↓ 0.0

Index Scan using bofige_pkey on bofige fgavder_1 (cost=0.57..4.50 rows=1 width=22) (actual rows= loops=)

  • Index Cond: ((copaip = bov_1.copaip) AND (copaip = 'FR'::bpchar) AND (nunati = bov_1.nunati) AND (nunati = '5694030194 '::bpchar))
  • Filter: ((cosu = '0'::bpchar) AND (cosu = bov_1.cosu) AND (dafige = (SubPlan 8)))
89.          

SubPlan (for Index Scan)

90. 0.000 0.000 ↓ 0.0

Result (cost=2.01..2.02 rows=1 width=4) (actual rows= loops=)

91.          

Initplan (for Result)

92. 0.000 0.000 ↓ 0.0

Limit (cost=0.57..2.01 rows=1 width=4) (actual rows= loops=)

93. 0.000 0.000 ↓ 0.0

Index Scan Backward using bofige_pkey on bofige bfavder_1 (cost=0.57..6.35 rows=4 width=4) (actual rows= loops=)

  • Index Cond: ((copaip = fgavder_1.copaip) AND (nunati = fgavder_1.nunati) AND (dafige IS NOT NULL))
  • Filter: (cosu = fgavder_1.cosu)