explain.depesz.com

PostgreSQL's explain analyze made readable

Result: cpT3

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

Sort (cost=468,196.55..468,201.97 rows=2,169 width=822) (actual rows= loops=)

  • Sort Key: t.uik_id, t.date_ord
2.          

CTE u

3. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=355.64..467,215.78 rows=2,162 width=262) (actual rows= loops=)

  • Hash Cond: (du.gas_status_id = gs.gas_status_id)
4. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=354.55..467,187.33 rows=2,162 width=213) (actual rows= loops=)

  • Hash Cond: (u.uik_number = gc."Number")
5. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=119.27..466,922.33 rows=2,162 width=176) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=118.87..192,187.05 rows=2,162 width=140) (actual rows= loops=)

  • Hash Cond: (u.district_id = d.district_id)
7. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=101.58..192,140.05 rows=2,162 width=98) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=101.43..191,776.99 rows=2,162 width=96) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Nested Loop (cost=101.15..190,837.80 rows=2,162 width=80) (actual rows= loops=)

  • Join Filter: (u.uik_type_id = ut.uik_type_id)
10. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=101.15..190,755.67 rows=2,162 width=72) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Hash Join (cost=97.06..873.64 rows=2,162 width=32) (actual rows= loops=)

  • Hash Cond: (u.tik_id = t_1.tik_id)
12. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on nsi_uik u (cost=78.33..849.17 rows=2,162 width=24) (actual rows= loops=)

  • Recheck Cond: (election_id = 18)
  • Filter: (io_id IS NOT NULL)
13. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on nsi_uik_election_id_idx (cost=0.00..77.79 rows=2,867 width=0) (actual rows= loops=)

  • Index Cond: (election_id = 18)
14. 0.000 0.000 ↓ 0.0

Hash (cost=13.88..13.88 rows=388 width=12) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Seq Scan on nsi_tik t_1 (cost=0.00..13.88 rows=388 width=12) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Limit (cost=4.09..87.81 rows=1 width=40) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.09..87.81 rows=1 width=40) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Hash Join (cost=3.69..84.12 rows=1 width=4) (actual rows= loops=)

  • Hash Cond: (up.user_id = ut_1.user_id)
19. 0.000 0.000 ↓ 0.0

Seq Scan on user_parent up (cost=0.00..69.73 rows=4,073 width=8) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Hash (cost=3.67..3.67 rows=1 width=4) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Seq Scan on user_tik ut_1 (cost=0.00..3.67 rows=1 width=4) (actual rows= loops=)

  • Filter: (tik_id = t_1.tik_id)
22. 0.000 0.000 ↓ 0.0

Index Scan using users_pkey on users b (cost=0.41..3.68 rows=1 width=57) (actual rows= loops=)

  • Index Cond: (id = up.parent_id)
23. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..1.04 rows=3 width=10) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Seq Scan on d_uik_type ut (cost=0.00..1.03 rows=3 width=10) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Index Scan using data_uik_pk on data_uik du (cost=0.28..0.43 rows=1 width=20) (actual rows= loops=)

  • Index Cond: (uik_id = u.uik_id)
26. 0.000 0.000 ↓ 0.0

Index Scan using nsi_io_pk on nsi_io i (cost=0.14..0.17 rows=1 width=6) (actual rows= loops=)

  • Index Cond: (io_id = u.io_id)
27. 0.000 0.000 ↓ 0.0

Hash (cost=11.80..11.80 rows=439 width=46) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=2.17..11.80 rows=439 width=46) (actual rows= loops=)

  • Hash Cond: (d.ao_id = a.ao_id)
29. 0.000 0.000 ↓ 0.0

Seq Scan on nsi_district d (cost=0.00..8.39 rows=439 width=31) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

Hash (cost=1.52..1.52 rows=52 width=19) (actual rows= loops=)

31. 0.000 0.000 ↓ 0.0

Seq Scan on nsi_ao a (cost=0.00..1.52 rows=52 width=19) (actual rows= loops=)

32. 0.000 0.000 ↓ 0.0

Limit (cost=0.41..127.05 rows=1 width=36) (actual rows= loops=)

33. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.41..127.05 rows=1 width=36) (actual rows= loops=)

  • Join Filter: (dg.group_id = w.group_id)
34. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.41..126.04 rows=1 width=4) (actual rows= loops=)

35. 0.000 0.000 ↓ 0.0

Seq Scan on user_uik uu (cost=0.00..117.59 rows=1 width=4) (actual rows= loops=)

  • Filter: (uik_id = u.uik_id)
36. 0.000 0.000 ↓ 0.0

Index Scan using users_pkey on users w (cost=0.41..8.45 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (id = uu.user_id)
37. 0.000 0.000 ↓ 0.0

Seq Scan on d_group dg (cost=0.00..1.00 rows=1 width=36) (actual rows= loops=)

38. 0.000 0.000 ↓ 0.0

Hash (cost=190.14..190.14 rows=3,611 width=41) (actual rows= loops=)

39. 0.000 0.000 ↓ 0.0

Seq Scan on gas_commission gc (cost=0.00..190.14 rows=3,611 width=41) (actual rows= loops=)

  • Filter: (campaignrole = 5)
40. 0.000 0.000 ↓ 0.0

Hash (cost=1.04..1.04 rows=4 width=21) (actual rows= loops=)

41. 0.000 0.000 ↓ 0.0

Seq Scan on d_gas_status gs (cost=0.00..1.04 rows=4 width=21) (actual rows= loops=)

42.          

CTE t

43. 0.000 0.000 ↓ 0.0

Append (cost=257.79..817.19 rows=2,169 width=790) (actual rows= loops=)

44. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=257.79..630.64 rows=7 width=454) (actual rows= loops=)

  • Hash Cond: (p.protocol_id = flk.protocol_id)
45. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=247.16..619.89 rows=7 width=387) (actual rows= loops=)

46. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=245.33..597.89 rows=7 width=385) (actual rows= loops=)

47. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=243.50..575.90 rows=7 width=381) (actual rows= loops=)

48. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=241.67..553.90 rows=7 width=377) (actual rows= loops=)

49. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=239.84..531.90 rows=7 width=373) (actual rows= loops=)

50. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=238.01..509.90 rows=7 width=369) (actual rows= loops=)

51. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=236.18..487.91 rows=7 width=365) (actual rows= loops=)

52. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=234.35..465.91 rows=7 width=361) (actual rows= loops=)

53. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=232.52..443.91 rows=7 width=357) (actual rows= loops=)

54. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=230.69..421.91 rows=7 width=353) (actual rows= loops=)

55. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=228.86..399.92 rows=7 width=349) (actual rows= loops=)

56. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=227.03..377.92 rows=7 width=345) (actual rows= loops=)

57. 0.000 0.000 ↓ 0.0

Nested Loop (cost=225.20..355.92 rows=7 width=341) (actual rows= loops=)

58. 0.000 0.000 ↓ 0.0

Hash Join (cost=225.07..354.86 rows=7 width=312) (actual rows= loops=)

  • Hash Cond: ((u_1.uik_id = p.uik_id) AND (u_1.election_id = p.election_id))
59. 0.000 0.000 ↓ 0.0

CTE Scan on u u_1 (cost=0.00..43.24 rows=2,162 width=290) (actual rows= loops=)

60. 0.000 0.000 ↓ 0.0

Hash (cost=194.20..194.20 rows=2,058 width=30) (actual rows= loops=)

61. 0.000 0.000 ↓ 0.0

Seq Scan on protocol p (cost=0.00..194.20 rows=2,058 width=30) (actual rows= loops=)

  • Filter: ((id_active > 0) AND (is_not_double = 1) AND (status_id = ANY ('{34,41,60,70}'::integer[])))
62. 0.000 0.000 ↓ 0.0

Index Scan using d_type_pk on d_type pt (cost=0.13..0.15 rows=1 width=33) (actual rows= loops=)

  • Index Cond: (type_id = p.type_id)
63. 0.000 0.000 ↓ 0.0

Index Scan using data_indicator_pk on data_indicator i1 (cost=1.83..3.14 rows=1 width=12) (actual rows= loops=)

  • Index Cond: ((protocol_id = p.protocol_id) AND (indicator_id = (SubPlan 2)))
64.          

SubPlan (forIndex Scan)

65. 0.000 0.000 ↓ 0.0

Seq Scan on indicator i_1 (cost=0.00..1.54 rows=1 width=4) (actual rows= loops=)

  • Filter: ((row_number = 1) AND (election_id = u_1.election_id))
66. 0.000 0.000 ↓ 0.0

Index Scan using data_indicator_pk on data_indicator i2 (cost=1.83..3.14 rows=1 width=12) (actual rows= loops=)

  • Index Cond: ((protocol_id = p.protocol_id) AND (indicator_id = (SubPlan 3)))
67.          

SubPlan (forIndex Scan)

68. 0.000 0.000 ↓ 0.0

Seq Scan on indicator i_2 (cost=0.00..1.54 rows=1 width=4) (actual rows= loops=)

  • Filter: ((row_number = 2) AND (election_id = u_1.election_id))
69. 0.000 0.000 ↓ 0.0

Index Scan using data_indicator_pk on data_indicator i3 (cost=1.83..3.14 rows=1 width=12) (actual rows= loops=)

  • Index Cond: ((protocol_id = p.protocol_id) AND (indicator_id = (SubPlan 4)))
70.          

SubPlan (forIndex Scan)

71. 0.000 0.000 ↓ 0.0

Seq Scan on indicator i_3 (cost=0.00..1.54 rows=1 width=4) (actual rows= loops=)

  • Filter: ((row_number = 3) AND (election_id = u_1.election_id))
72. 0.000 0.000 ↓ 0.0

Index Scan using data_indicator_pk on data_indicator i4 (cost=1.83..3.14 rows=1 width=12) (actual rows= loops=)

  • Index Cond: ((protocol_id = p.protocol_id) AND (indicator_id = (SubPlan 5)))
73.          

SubPlan (forIndex Scan)

74. 0.000 0.000 ↓ 0.0

Seq Scan on indicator i_4 (cost=0.00..1.54 rows=1 width=4) (actual rows= loops=)

  • Filter: ((row_number = 4) AND (election_id = u_1.election_id))
75. 0.000 0.000 ↓ 0.0

Index Scan using data_indicator_pk on data_indicator i5 (cost=1.83..3.14 rows=1 width=12) (actual rows= loops=)

  • Index Cond: ((protocol_id = p.protocol_id) AND (indicator_id = (SubPlan 6)))
76.          

SubPlan (forIndex Scan)

77. 0.000 0.000 ↓ 0.0

Seq Scan on indicator i_5 (cost=0.00..1.54 rows=1 width=4) (actual rows= loops=)

  • Filter: ((row_number = 5) AND (election_id = u_1.election_id))
78. 0.000 0.000 ↓ 0.0

Index Scan using data_indicator_pk on data_indicator i6 (cost=1.83..3.14 rows=1 width=12) (actual rows= loops=)

  • Index Cond: ((protocol_id = p.protocol_id) AND (indicator_id = (SubPlan 7)))
79.          

SubPlan (forIndex Scan)

80. 0.000 0.000 ↓ 0.0

Seq Scan on indicator i_6 (cost=0.00..1.54 rows=1 width=4) (actual rows= loops=)

  • Filter: ((row_number = 6) AND (election_id = u_1.election_id))
81. 0.000 0.000 ↓ 0.0

Index Scan using data_indicator_pk on data_indicator i7 (cost=1.83..3.14 rows=1 width=12) (actual rows= loops=)

  • Index Cond: ((protocol_id = p.protocol_id) AND (indicator_id = (SubPlan 8)))
82.          

SubPlan (forIndex Scan)

83. 0.000 0.000 ↓ 0.0

Seq Scan on indicator i_7 (cost=0.00..1.54 rows=1 width=4) (actual rows= loops=)

  • Filter: ((row_number = 7) AND (election_id = u_1.election_id))
84. 0.000 0.000 ↓ 0.0

Index Scan using data_indicator_pk on data_indicator i8 (cost=1.83..3.14 rows=1 width=12) (actual rows= loops=)

  • Index Cond: ((protocol_id = p.protocol_id) AND (indicator_id = (SubPlan 9)))
85.          

SubPlan (forIndex Scan)

86. 0.000 0.000 ↓ 0.0

Seq Scan on indicator i_8 (cost=0.00..1.54 rows=1 width=4) (actual rows= loops=)

  • Filter: ((row_number = 8) AND (election_id = u_1.election_id))
87. 0.000 0.000 ↓ 0.0

Index Scan using data_indicator_pk on data_indicator i9 (cost=1.83..3.14 rows=1 width=12) (actual rows= loops=)

  • Index Cond: ((protocol_id = p.protocol_id) AND (indicator_id = (SubPlan 10)))
88.          

SubPlan (forIndex Scan)

89. 0.000 0.000 ↓ 0.0

Seq Scan on indicator i_9 (cost=0.00..1.54 rows=1 width=4) (actual rows= loops=)

  • Filter: ((row_number = 9) AND (election_id = u_1.election_id))
90. 0.000 0.000 ↓ 0.0

Index Scan using data_indicator_pk on data_indicator i10 (cost=1.83..3.14 rows=1 width=12) (actual rows= loops=)

  • Index Cond: ((protocol_id = p.protocol_id) AND (indicator_id = (SubPlan 11)))
91.          

SubPlan (forIndex Scan)

92. 0.000 0.000 ↓ 0.0

Seq Scan on indicator i_10 (cost=0.00..1.54 rows=1 width=4) (actual rows= loops=)

  • Filter: ((row_number = 10) AND (election_id = u_1.election_id))
93. 0.000 0.000 ↓ 0.0

Index Scan using data_indicator_pk on data_indicator i11 (cost=1.83..3.14 rows=1 width=12) (actual rows= loops=)

  • Index Cond: ((protocol_id = p.protocol_id) AND (indicator_id = (SubPlan 12)))
94.          

SubPlan (forIndex Scan)

95. 0.000 0.000 ↓ 0.0

Seq Scan on indicator i_11 (cost=0.00..1.54 rows=1 width=4) (actual rows= loops=)

  • Filter: ((row_number = 11) AND (election_id = u_1.election_id))
96. 0.000 0.000 ↓ 0.0

Index Scan using data_indicator_pk on data_indicator i12 (cost=1.83..3.14 rows=1 width=12) (actual rows= loops=)

  • Index Cond: ((protocol_id = p.protocol_id) AND (indicator_id = (SubPlan 13)))
97.          

SubPlan (forIndex Scan)

98. 0.000 0.000 ↓ 0.0

Seq Scan on indicator i_12 (cost=0.00..1.54 rows=1 width=4) (actual rows= loops=)

  • Filter: ((row_number = 12) AND (election_id = u_1.election_id))
99. 0.000 0.000 ↓ 0.0

Hash (cost=10.61..10.61 rows=1 width=36) (actual rows= loops=)

100. 0.000 0.000 ↓ 0.0

Subquery Scan on flk (cost=10.58..10.61 rows=1 width=36) (actual rows= loops=)

101. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=10.58..10.60 rows=1 width=36) (actual rows= loops=)

  • Group Key: p_1.protocol_id
102. 0.000 0.000 ↓ 0.0

Sort (cost=10.58..10.59 rows=1 width=40) (actual rows= loops=)

  • Sort Key: p_1.protocol_id
103. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.28..10.57 rows=1 width=40) (actual rows= loops=)

  • Join Filter: ((f.election_id = p_1.election_id) AND (f.flc_id = ff.flc_id))
104. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.28..9.31 rows=1 width=10) (actual rows= loops=)

105. 0.000 0.000 ↓ 0.0

Seq Scan on flc_fail ff (cost=0.00..1.00 rows=1 width=6) (actual rows= loops=)

106. 0.000 0.000 ↓ 0.0

Index Scan using protocol_pk on protocol p_1 (cost=0.28..8.31 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (protocol_id = ff.protocol_id)
  • Filter: ((id_active > 0) AND (election_id = 18))
107. 0.000 0.000 ↓ 0.0

Seq Scan on d_flc f (cost=0.00..1.19 rows=5 width=42) (actual rows= loops=)

  • Filter: (election_id = 18)
108. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2 (cost=18.55..175.63 rows=2,162 width=790) (actual rows= loops=)

109. 0.000 0.000 ↓ 0.0

Hash Join (cost=18.55..83.75 rows=2,162 width=450) (actual rows= loops=)

  • Hash Cond: (u_2.commission = gp.commission)
110. 0.000 0.000 ↓ 0.0

CTE Scan on u u_2 (cost=0.00..43.24 rows=2,162 width=320) (actual rows= loops=)

111. 0.000 0.000 ↓ 0.0

Hash (cost=13.80..13.80 rows=380 width=93) (actual rows= loops=)

112. 0.000 0.000 ↓ 0.0

Seq Scan on gas_protocol gp (cost=0.00..13.80 rows=380 width=93) (actual rows= loops=)

113. 0.000 0.000 ↓ 0.0

CTE Scan on t (cost=0.00..43.38 rows=2,169 width=822) (actual rows= loops=)