explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Rsbe

Settings
# exclusive inclusive rows x rows loops node
1. 0.157 2,047.433 ↑ 1.0 1 1

Index Scan using post_struct_pkey on post_struct __local_0__ (cost=0.15..57,860,058.68 rows=1 width=128) (actual time=2,047.413..2,047.433 rows=1 loops=1)

  • Index Cond: (id = 1010)
  • Filter: (((deleted_at IS NULL) OR (deleted_at = now())) AND (channel_id = ANY ((current_setting('jwt.claims.channel_creator_for'::text))::integer[])))
2.          

SubPlan (for Index Scan)

3. 0.004 0.070 ↑ 1.0 1 1

Result (cost=54.54..54.55 rows=1 width=32) (actual time=0.070..0.070 rows=1 loops=1)

4.          

CTE __local_1__

5. 0.009 0.054 ↑ 1.0 1 1

Subquery Scan on __local_2___1 (cost=54.46..54.48 rows=1 width=32) (actual time=0.053..0.054 rows=1 loops=1)

6. 0.005 0.045 ↑ 1.0 1 1

Sort (cost=54.46..54.47 rows=1 width=96) (actual time=0.044..0.045 rows=1 loops=1)

  • Sort Key: (row_number() OVER (?)) DESC
  • Sort Method: quicksort Memory: 25kB
7.          

CTE __local_3__

8. 0.001 0.028 ↑ 1.0 1 1

Limit (cost=54.41..54.42 rows=1 width=84) (actual time=0.027..0.028 rows=1 loops=1)

9. 0.003 0.027 ↑ 1.0 1 1

Sort (cost=54.41..54.42 rows=1 width=84) (actual time=0.027..0.027 rows=1 loops=1)

  • Sort Key: __local_2__.id DESC
  • Sort Method: quicksort Memory: 25kB
10. 0.015 0.024 ↑ 1.0 1 1

Seq Scan on post_instance __local_2__ (cost=28.20..54.40 rows=1 width=84) (actual time=0.022..0.024 rows=1 loops=1)

  • Filter: ((hashed SubPlan 1) AND (post_struct_id = __local_0__.id) AND (person_id = 4321) AND ((deleted_at IS NULL) OR (deleted_at = now())))
  • Rows Removed by Filter: 2
11.          

SubPlan (for Seq Scan)

12. 0.009 0.009 ↓ 3.0 3 1

Seq Scan on post_struct (cost=0.00..28.20 rows=1 width=4) (actual time=0.005..0.009 rows=3 loops=1)

  • Filter: (((deleted_at IS NULL) OR (deleted_at = now())) AND (channel_id = ANY ((current_setting('jwt.claims.channel_creator_for'::text))::integer[])))
13. 0.009 0.040 ↑ 1.0 1 1

WindowAgg (cost=0.00..0.03 rows=1 width=96) (actual time=0.038..0.040 rows=1 loops=1)

14. 0.031 0.031 ↑ 1.0 1 1

CTE Scan on __local_3__ (cost=0.00..0.02 rows=1 width=28) (actual time=0.030..0.031 rows=1 loops=1)

15.          

CTE __local_4__

16. 0.006 0.064 ↑ 1.0 1 1

Aggregate (cost=0.03..0.04 rows=1 width=32) (actual time=0.064..0.064 rows=1 loops=1)

17. 0.058 0.058 ↑ 1.0 1 1

CTE Scan on __local_1__ (cost=0.00..0.02 rows=1 width=24) (actual time=0.057..0.058 rows=1 loops=1)

18.          

Initplan (for Result)

19. 0.066 0.066 ↑ 1.0 1 1

CTE Scan on __local_4__ (cost=0.00..0.02 rows=1 width=32) (actual time=0.066..0.066 rows=1 loops=1)

20. 0.142 2,047.206 ↑ 1.0 1 1

Result (cost=57,859,995.91..57,859,995.93 rows=1 width=32) (actual time=2,047.195..2,047.206 rows=1 loops=1)

21.          

CTE __local_5__

22. 1.320 2,046.309 ↑ 1.0 100 1

Subquery Scan on __local_6___1 (cost=45.63..57,859,962.24 rows=100 width=64) (actual time=30.684..2,046.309 rows=100 loops=1)

23. 0.061 0.289 ↑ 1.0 100 1

Sort (cost=45.63..45.88 rows=100 width=140) (actual time=0.267..0.289 rows=100 loops=1)

  • Sort Key: (row_number() OVER (?)) DESC
  • Sort Method: quicksort Memory: 39kB
24.          

CTE __local_35__

25. 0.013 0.090 ↑ 1.0 100 1

Limit (cost=28.49..38.80 rows=100 width=120) (actual time=0.021..0.090 rows=100 loops=1)

26. 0.068 0.077 ↑ 50.0 100 1

Index Scan Backward using flow_struct_pkey on flow_struct __local_6__ (cost=28.49..544.56 rows=5,002 width=120) (actual time=0.021..0.077 rows=100 loops=1)

  • Filter: ((hashed SubPlan 67) AND (post_struct_id = __local_0__.id) AND ((deleted_at IS NULL) OR (deleted_at = now())))
27.          

SubPlan (for Index Scan Backward)

28. 0.009 0.009 ↓ 3.0 3 1

Seq Scan on post_struct post_struct_9 (cost=0.00..28.20 rows=1 width=4) (actual time=0.006..0.009 rows=3 loops=1)

  • Filter: (((deleted_at IS NULL) OR (deleted_at = now())) AND (channel_id = ANY ((current_setting('jwt.claims.channel_creator_for'::text))::integer[])))
29. 0.095 0.228 ↑ 1.0 100 1

WindowAgg (cost=0.00..3.50 rows=100 width=140) (actual time=0.029..0.228 rows=100 loops=1)

30. 0.133 0.133 ↑ 1.0 100 1

CTE Scan on __local_35__ (cost=0.00..2.00 rows=100 width=40) (actual time=0.023..0.133 rows=100 loops=1)

31.          

SubPlan (for Subquery Scan)

32. 0.200 245.300 ↑ 1.0 1 100

Result (cost=667.94..667.95 rows=1 width=32) (actual time=2.453..2.453 rows=1 loops=100)

33.          

CTE __local_7__

34. 0.000 244.900 ↓ 0.0 0 100

Subquery Scan on __local_8___1 (cost=667.86..667.88 rows=1 width=32) (actual time=2.449..2.449 rows=0 loops=100)

35. 0.100 244.900 ↓ 0.0 0 100

Sort (cost=667.86..667.87 rows=1 width=96) (actual time=2.449..2.449 rows=0 loops=100)

  • Sort Key: (row_number() OVER (?)) DESC
  • Sort Method: quicksort Memory: 25kB
36.          

CTE __local_9__

37. 0.100 244.700 ↓ 0.0 0 100

Limit (cost=667.81..667.82 rows=1 width=84) (actual time=2.447..2.447 rows=0 loops=100)

38. 0.200 244.600 ↓ 0.0 0 100

Sort (cost=667.81..667.82 rows=1 width=84) (actual time=2.446..2.446 rows=0 loops=100)

  • Sort Key: __local_8__.id DESC
  • Sort Method: quicksort Memory: 25kB
39. 240.344 244.400 ↓ 0.0 0 100

Seq Scan on flow_instance __local_8__ (cost=358.76..667.80 rows=1 width=84) (actual time=2.444..2.444 rows=0 loops=100)

  • Filter: ((hashed SubPlan 8) AND (flow_struct_id = __local_6___1.id) AND (person_id = 4321) AND ((deleted_at IS NULL) OR (deleted_at = now())))
  • Rows Removed by Filter: 10002
40.          

SubPlan (for Seq Scan)

41. 4.048 4.056 ↓ 2.0 10,003 1

Seq Scan on flow_struct (cost=28.20..346.25 rows=5,002 width=4) (actual time=0.020..4.056 rows=10,003 loops=1)

  • Filter: ((hashed SubPlan 7) AND ((deleted_at IS NULL) OR (deleted_at = now())))
42.          

SubPlan (for Seq Scan)

43. 0.008 0.008 ↓ 3.0 3 1

Seq Scan on post_struct post_struct_1 (cost=0.00..28.20 rows=1 width=4) (actual time=0.005..0.008 rows=3 loops=1)

  • Filter: (((deleted_at IS NULL) OR (deleted_at = now())) AND (channel_id = ANY ((current_setting('jwt.claims.channel_creator_for'::text))::integer[])))
44. 0.100 244.800 ↓ 0.0 0 100

WindowAgg (cost=0.00..0.03 rows=1 width=96) (actual time=2.448..2.448 rows=0 loops=100)

45. 244.700 244.700 ↓ 0.0 0 100

CTE Scan on __local_9__ (cost=0.00..0.02 rows=1 width=20) (actual time=2.447..2.447 rows=0 loops=100)

46.          

CTE __local_10__

47. 0.000 245.000 ↑ 1.0 1 100

Aggregate (cost=0.03..0.04 rows=1 width=32) (actual time=2.450..2.450 rows=1 loops=100)

48. 245.000 245.000 ↓ 0.0 0 100

CTE Scan on __local_7__ (cost=0.00..0.02 rows=1 width=24) (actual time=2.450..2.450 rows=0 loops=100)

49.          

Initplan (for Result)

50. 245.100 245.100 ↑ 1.0 1 100

CTE Scan on __local_10__ (cost=0.00..0.02 rows=1 width=32) (actual time=2.451..2.451 rows=1 loops=100)

51. 0.500 1,799.400 ↑ 1.0 1 100

Result (cost=577,931.17..577,931.18 rows=1 width=32) (actual time=17.994..17.994 rows=1 loops=100)

52.          

CTE __local_11__

53. 1.700 1,568.700 ↑ 100.0 1 100

Subquery Scan on __local_12___1 (cost=386.50..577,566.75 rows=100 width=64) (actual time=3.496..15.687 rows=1 loops=100)

54. 0.100 276.100 ↑ 100.0 1 100

Sort (cost=386.50..386.75 rows=100 width=140) (actual time=2.761..2.761 rows=1 loops=100)

  • Sort Key: (row_number() OVER (?)) DESC
  • Sort Method: quicksort Memory: 25kB
55.          

CTE __local_33__

56. 0.100 275.800 ↑ 100.0 1 100

Limit (cost=359.05..379.68 rows=100 width=120) (actual time=2.757..2.758 rows=1 loops=100)

57. 272.126 275.700 ↑ 2,501.0 1 100

Index Scan Backward using block_struct_pkey on block_struct __local_12__ (cost=359.05..875.12 rows=2,501 width=120) (actual time=2.757..2.757 rows=1 loops=100)

  • Filter: ((hashed SubPlan 57) AND (flow_struct_id = __local_6___1.id) AND ((deleted_at IS NULL) OR (deleted_at = now())))
  • Rows Removed by Filter: 9903
58.          

SubPlan (for Index Scan Backward)

59. 3.557 3.574 ↓ 2.0 10,003 1

Seq Scan on flow_struct flow_struct_6 (cost=28.20..346.25 rows=5,002 width=4) (actual time=0.032..3.574 rows=10,003 loops=1)

  • Filter: ((hashed SubPlan 56) AND ((deleted_at IS NULL) OR (deleted_at = now())))
60.          

SubPlan (for Seq Scan)

61. 0.017 0.017 ↓ 3.0 3 1

Seq Scan on post_struct post_struct_7 (cost=0.00..28.20 rows=1 width=4) (actual time=0.014..0.017 rows=3 loops=1)

  • Filter: (((deleted_at IS NULL) OR (deleted_at = now())) AND (channel_id = ANY ((current_setting('jwt.claims.channel_creator_for'::text))::integer[])))
62. 0.200 276.000 ↑ 100.0 1 100

WindowAgg (cost=0.00..3.50 rows=100 width=140) (actual time=2.758..2.760 rows=1 loops=100)

63. 275.800 275.800 ↑ 100.0 1 100

CTE Scan on __local_33__ (cost=0.00..2.00 rows=100 width=40) (actual time=2.758..2.758 rows=1 loops=100)

64.          

SubPlan (for Subquery Scan)

65. 0.200 254.400 ↑ 1.0 1 100

Result (cost=998.52..998.53 rows=1 width=32) (actual time=2.544..2.544 rows=1 loops=100)

66.          

CTE __local_13__

67. 0.100 253.900 ↓ 0.0 0 100

Subquery Scan on __local_14___1 (cost=998.44..998.46 rows=1 width=32) (actual time=2.539..2.539 rows=0 loops=100)

68. 0.100 253.800 ↓ 0.0 0 100

Sort (cost=998.44..998.45 rows=1 width=96) (actual time=2.538..2.538 rows=0 loops=100)

  • Sort Key: (row_number() OVER (?)) DESC
  • Sort Method: quicksort Memory: 25kB
69.          

CTE __local_15__

70. 0.000 253.600 ↓ 0.0 0 100

Limit (cost=998.39..998.40 rows=1 width=84) (actual time=2.536..2.536 rows=0 loops=100)

71. 0.300 253.600 ↓ 0.0 0 100

Sort (cost=998.39..998.40 rows=1 width=84) (actual time=2.536..2.536 rows=0 loops=100)

  • Sort Key: __local_14__.id DESC
  • Sort Method: quicksort Memory: 25kB
72. 245.301 253.300 ↓ 0.0 0 100

Seq Scan on block_instance __local_14__ (cost=689.32..998.38 rows=1 width=84) (actual time=2.533..2.533 rows=0 loops=100)

  • Filter: ((hashed SubPlan 16) AND (block_struct_id = __local_12___1.id) AND (person_id = 4321) AND ((deleted_at IS NULL) OR (deleted_at = now())))
  • Rows Removed by Filter: 10003
73.          

SubPlan (for Seq Scan)

74. 5.038 7.999 ↓ 2.0 10,003 1

Seq Scan on block_struct (cost=358.76..676.81 rows=5,002 width=4) (actual time=5.224..7.999 rows=10,003 loops=1)

  • Filter: ((hashed SubPlan 15) AND ((deleted_at IS NULL) OR (deleted_at = now())))
75.          

SubPlan (for Seq Scan)

76. 2.948 2.961 ↓ 2.0 10,003 1

Seq Scan on flow_struct flow_struct_1 (cost=28.20..346.25 rows=5,002 width=4) (actual time=0.021..2.961 rows=10,003 loops=1)

  • Filter: ((hashed SubPlan 14) AND ((deleted_at IS NULL) OR (deleted_at = now())))
77.          

SubPlan (for Seq Scan)

78. 0.013 0.013 ↓ 3.0 3 1

Seq Scan on post_struct post_struct_2 (cost=0.00..28.20 rows=1 width=4) (actual time=0.010..0.013 rows=3 loops=1)

  • Filter: (((deleted_at IS NULL) OR (deleted_at = now())) AND (channel_id = ANY ((current_setting('jwt.claims.channel_creator_for'::text))::integer[])))
79. 0.000 253.700 ↓ 0.0 0 100

WindowAgg (cost=0.00..0.03 rows=1 width=96) (actual time=2.537..2.537 rows=0 loops=100)

80. 253.700 253.700 ↓ 0.0 0 100

CTE Scan on __local_15__ (cost=0.00..0.02 rows=1 width=56) (actual time=2.537..2.537 rows=0 loops=100)

81.          

CTE __local_16__

82. 0.100 254.100 ↑ 1.0 1 100

Aggregate (cost=0.03..0.04 rows=1 width=32) (actual time=2.541..2.541 rows=1 loops=100)

83. 254.000 254.000 ↓ 0.0 0 100

CTE Scan on __local_13__ (cost=0.00..0.02 rows=1 width=24) (actual time=2.540..2.540 rows=0 loops=100)

84.          

Initplan (for Result)

85. 254.200 254.200 ↑ 1.0 1 100

CTE Scan on __local_16__ (cost=0.00..0.02 rows=1 width=32) (actual time=2.541..2.542 rows=1 loops=100)

86. 0.100 525.100 ↑ 1.0 1 100

Result (cost=2,411.55..2,411.56 rows=1 width=32) (actual time=5.251..5.251 rows=1 loops=100)

87.          

CTE __local_17__

88. 0.600 524.400 ↑ 1.0 1 100

Subquery Scan on __local_18___1 (cost=1,032.42..2,411.49 rows=1 width=32) (actual time=5.244..5.244 rows=1 loops=100)

89. 0.200 256.200 ↑ 1.0 1 100

Sort (cost=1,032.42..1,032.42 rows=1 width=140) (actual time=2.562..2.562 rows=1 loops=100)

  • Sort Key: (row_number() OVER (?)) DESC
  • Sort Method: quicksort Memory: 25kB
90.          

CTE __local_23__

91. 0.200 255.700 ↑ 1.0 1 100

Limit (cost=1,032.37..1,032.37 rows=1 width=120) (actual time=2.555..2.557 rows=1 loops=100)

92. 0.300 255.500 ↑ 1.0 1 100

Sort (cost=1,032.37..1,032.37 rows=1 width=120) (actual time=2.555..2.555 rows=1 loops=100)

  • Sort Key: __local_18__.id DESC
  • Sort Method: quicksort Memory: 25kB
93. 247.386 255.200 ↑ 1.0 1 100

Seq Scan on input_struct __local_18__ (cost=689.32..1,032.36 rows=1 width=120) (actual time=2.541..2.552 rows=1 loops=100)

  • Filter: ((hashed SubPlan 33) AND (block_struct_id = __local_12___1.id) AND ((deleted_at IS NULL) OR (deleted_at = now())))
  • Rows Removed by Filter: 10001
94.          

SubPlan (for Seq Scan)

95. 5.000 7.814 ↓ 2.0 10,003 1

Seq Scan on block_struct block_struct_2 (cost=358.76..676.81 rows=5,002 width=4) (actual time=5.062..7.814 rows=10,003 loops=1)

  • Filter: ((hashed SubPlan 32) AND ((deleted_at IS NULL) OR (deleted_at = now())))
96.          

SubPlan (for Seq Scan)

97. 2.801 2.814 ↓ 2.0 10,003 1

Seq Scan on flow_struct flow_struct_3 (cost=28.20..346.25 rows=5,002 width=4) (actual time=0.019..2.814 rows=10,003 loops=1)

  • Filter: ((hashed SubPlan 31) AND ((deleted_at IS NULL) OR (deleted_at = now())))
98.          

SubPlan (for Seq Scan)

99. 0.013 0.013 ↓ 3.0 3 1

Seq Scan on post_struct post_struct_4 (cost=0.00..28.20 rows=1 width=4) (actual time=0.007..0.013 rows=3 loops=1)

  • Filter: (((deleted_at IS NULL) OR (deleted_at = now())) AND (channel_id = ANY ((current_setting('jwt.claims.channel_creator_for'::text))::integer[])))
100. 0.200 256.000 ↑ 1.0 1 100

WindowAgg (cost=0.00..0.03 rows=1 width=140) (actual time=2.558..2.560 rows=1 loops=100)

101. 255.800 255.800 ↑ 1.0 1 100

CTE Scan on __local_23__ (cost=0.00..0.02 rows=1 width=40) (actual time=2.556..2.558 rows=1 loops=100)

102.          

SubPlan (for Subquery Scan)

103. 0.200 267.600 ↑ 1.0 1 100

Result (cost=1,379.04..1,379.05 rows=1 width=32) (actual time=2.676..2.676 rows=1 loops=100)

104.          

CTE __local_19__

105. 0.100 267.100 ↓ 0.0 0 100

Subquery Scan on __local_20___1 (cost=1,378.96..1,378.98 rows=1 width=32) (actual time=2.671..2.671 rows=0 loops=100)

106. 0.100 267.000 ↓ 0.0 0 100

Sort (cost=1,378.96..1,378.97 rows=1 width=160) (actual time=2.670..2.670 rows=0 loops=100)

  • Sort Key: (row_number() OVER (?)) DESC
  • Sort Method: quicksort Memory: 25kB
107.          

CTE __local_21__

108. 0.000 266.800 ↓ 0.0 0 100

Limit (cost=1,378.91..1,378.92 rows=1 width=122) (actual time=2.668..2.668 rows=0 loops=100)

109. 0.300 266.800 ↓ 0.0 0 100

Sort (cost=1,378.91..1,378.92 rows=1 width=122) (actual time=2.668..2.668 rows=0 loops=100)

  • Sort Key: __local_20__.id DESC
  • Sort Method: quicksort Memory: 25kB
110. 253.591 266.500 ↓ 0.0 0 100

Seq Scan on input_instance __local_20__ (cost=1,019.86..1,378.90 rows=1 width=122) (actual time=2.665..2.665 rows=0 loops=100)

  • Filter: ((hashed SubPlan 25) AND (input_struct_id = __local_18___1.id) AND (person_id = 4321) AND ((deleted_at IS NULL) OR (deleted_at = now())))
  • Rows Removed by Filter: 10002
111.          

SubPlan (for Seq Scan)

112. 5.069 12.909 ↓ 2.0 10,002 1

Seq Scan on input_struct (cost=689.32..1,007.35 rows=5,001 width=4) (actual time=9.984..12.909 rows=10,002 loops=1)

  • Filter: ((hashed SubPlan 24) AND ((deleted_at IS NULL) OR (deleted_at = now())))
113.          

SubPlan (for Seq Scan)

114. 5.003 7.840 ↓ 2.0 10,003 1

Seq Scan on block_struct block_struct_1 (cost=358.76..676.81 rows=5,002 width=4) (actual time=5.051..7.840 rows=10,003 loops=1)

  • Filter: ((hashed SubPlan 23) AND ((deleted_at IS NULL) OR (deleted_at = now())))
115.          

SubPlan (for Seq Scan)

116. 2.828 2.837 ↓ 2.0 10,003 1

Seq Scan on flow_struct flow_struct_2 (cost=28.20..346.25 rows=5,002 width=4) (actual time=0.017..2.837 rows=10,003 loops=1)

  • Filter: ((hashed SubPlan 22) AND ((deleted_at IS NULL) OR (deleted_at = now())))
117.          

SubPlan (for Seq Scan)

118. 0.009 0.009 ↓ 3.0 3 1

Seq Scan on post_struct post_struct_3 (cost=0.00..28.20 rows=1 width=4) (actual time=0.007..0.009 rows=3 loops=1)

  • Filter: (((deleted_at IS NULL) OR (deleted_at = now())) AND (channel_id = ANY ((current_setting('jwt.claims.channel_creator_for'::text))::integer[])))
119. 0.100 266.900 ↓ 0.0 0 100

WindowAgg (cost=0.00..0.03 rows=1 width=160) (actual time=2.669..2.669 rows=0 loops=100)

120. 266.800 266.800 ↓ 0.0 0 100

CTE Scan on __local_21__ (cost=0.00..0.02 rows=1 width=20) (actual time=2.668..2.668 rows=0 loops=100)

121.          

CTE __local_22__

122. 0.100 267.300 ↑ 1.0 1 100

Aggregate (cost=0.03..0.04 rows=1 width=32) (actual time=2.672..2.673 rows=1 loops=100)

123. 267.200 267.200 ↓ 0.0 0 100

CTE Scan on __local_19__ (cost=0.00..0.02 rows=1 width=24) (actual time=2.672..2.672 rows=0 loops=100)

124.          

Initplan (for Result)

125. 267.400 267.400 ↑ 1.0 1 100

CTE Scan on __local_22__ (cost=0.00..0.02 rows=1 width=32) (actual time=2.673..2.674 rows=1 loops=100)

126.          

CTE __local_24__

127. 0.200 524.800 ↑ 1.0 1 100

Aggregate (cost=0.03..0.04 rows=1 width=32) (actual time=5.248..5.248 rows=1 loops=100)

128. 524.600 524.600 ↑ 1.0 1 100

CTE Scan on __local_17__ (cost=0.00..0.02 rows=1 width=24) (actual time=5.245..5.246 rows=1 loops=100)

129.          

Initplan (for Result)

130. 525.000 525.000 ↑ 1.0 1 100

CTE Scan on __local_24__ (cost=0.00..0.02 rows=1 width=32) (actual time=5.249..5.250 rows=1 loops=100)

131. 0.200 511.400 ↑ 1.0 1 100

Result (cost=2,361.67..2,361.68 rows=1 width=32) (actual time=5.114..5.114 rows=1 loops=100)

132.          

CTE __local_25__

133. 0.600 510.800 ↑ 1.0 1 100

Subquery Scan on __local_26___1 (cost=1,032.46..2,361.61 rows=1 width=32) (actual time=5.107..5.108 rows=1 loops=100)

134. 0.200 256.800 ↑ 1.0 1 100

Sort (cost=1,032.46..1,032.46 rows=1 width=140) (actual time=2.568..2.568 rows=1 loops=100)

  • Sort Key: (row_number() OVER (?)) DESC
  • Sort Method: quicksort Memory: 25kB
135.          

CTE __local_31__

136. 0.200 256.300 ↑ 1.0 1 100

Limit (cost=1,032.41..1,032.41 rows=1 width=121) (actual time=2.562..2.563 rows=1 loops=100)

137. 0.200 256.100 ↑ 1.0 1 100

Sort (cost=1,032.41..1,032.41 rows=1 width=121) (actual time=2.561..2.561 rows=1 loops=100)

  • Sort Key: __local_26__.id DESC
  • Sort Method: quicksort Memory: 25kB
138. 247.915 255.900 ↑ 1.0 1 100

Seq Scan on message_struct __local_26__ (cost=689.32..1,032.40 rows=1 width=121) (actual time=2.547..2.559 rows=1 loops=100)

  • Filter: ((hashed SubPlan 50) AND (block_struct_id = __local_12___1.id) AND ((deleted_at IS NULL) OR (deleted_at = now())))
  • Rows Removed by Filter: 10003
139.          

SubPlan (for Seq Scan)

140. 5.077 7.985 ↓ 2.0 10,003 1

Seq Scan on block_struct block_struct_4 (cost=358.76..676.81 rows=5,002 width=4) (actual time=5.165..7.985 rows=10,003 loops=1)

  • Filter: ((hashed SubPlan 49) AND ((deleted_at IS NULL) OR (deleted_at = now())))
141.          

SubPlan (for Seq Scan)

142. 2.894 2.908 ↓ 2.0 10,003 1

Seq Scan on flow_struct flow_struct_5 (cost=28.20..346.25 rows=5,002 width=4) (actual time=0.018..2.908 rows=10,003 loops=1)

  • Filter: ((hashed SubPlan 48) AND ((deleted_at IS NULL) OR (deleted_at = now())))
143.          

SubPlan (for Seq Scan)

144. 0.014 0.014 ↓ 3.0 3 1

Seq Scan on post_struct post_struct_6 (cost=0.00..28.20 rows=1 width=4) (actual time=0.007..0.014 rows=3 loops=1)

  • Filter: (((deleted_at IS NULL) OR (deleted_at = now())) AND (channel_id = ANY ((current_setting('jwt.claims.channel_creator_for'::text))::integer[])))
145. 0.200 256.600 ↑ 1.0 1 100

WindowAgg (cost=0.00..0.03 rows=1 width=140) (actual time=2.564..2.566 rows=1 loops=100)

146. 256.400 256.400 ↑ 1.0 1 100

CTE Scan on __local_31__ (cost=0.00..0.02 rows=1 width=40) (actual time=2.563..2.564 rows=1 loops=100)

147.          

SubPlan (for Subquery Scan)

148. 0.300 253.400 ↑ 1.0 1 100

Result (cost=1,329.12..1,329.13 rows=1 width=32) (actual time=2.534..2.534 rows=1 loops=100)

149.          

CTE __local_27__

150. 0.100 252.900 ↓ 0.0 0 100

Subquery Scan on __local_28___1 (cost=1,329.04..1,329.06 rows=1 width=32) (actual time=2.529..2.529 rows=0 loops=100)

151. 0.100 252.800 ↓ 0.0 0 100

Sort (cost=1,329.04..1,329.05 rows=1 width=96) (actual time=2.528..2.528 rows=0 loops=100)

  • Sort Key: (row_number() OVER (?)) DESC
  • Sort Method: quicksort Memory: 25kB
152.          

CTE __local_29__

153. 0.100 252.600 ↓ 0.0 0 100

Limit (cost=1,328.99..1,329.00 rows=1 width=84) (actual time=2.526..2.526 rows=0 loops=100)

154. 0.200 252.500 ↓ 0.0 0 100

Sort (cost=1,328.99..1,329.00 rows=1 width=84) (actual time=2.525..2.525 rows=0 loops=100)

  • Sort Key: __local_28__.id DESC
  • Sort Method: quicksort Memory: 25kB
155. 239.180 252.300 ↓ 0.0 0 100

Seq Scan on message_instance __local_28__ (cost=1,019.89..1,328.98 rows=1 width=84) (actual time=2.523..2.523 rows=0 loops=100)

  • Filter: ((hashed SubPlan 42) AND (message_struct_id = __local_26___1.id) AND (person_id = 4321) AND ((deleted_at IS NULL) OR (deleted_at = now())))
  • Rows Removed by Filter: 10004
156.          

SubPlan (for Seq Scan)

157. 5.281 13.120 ↓ 2.0 10,004 1

Seq Scan on message_struct (cost=689.32..1,007.39 rows=5,002 width=4) (actual time=10.117..13.120 rows=10,004 loops=1)

  • Filter: ((hashed SubPlan 41) AND ((deleted_at IS NULL) OR (deleted_at = now())))
158.          

SubPlan (for Seq Scan)

159. 5.030 7.839 ↓ 2.0 10,003 1

Seq Scan on block_struct block_struct_3 (cost=358.76..676.81 rows=5,002 width=4) (actual time=5.068..7.839 rows=10,003 loops=1)

  • Filter: ((hashed SubPlan 40) AND ((deleted_at IS NULL) OR (deleted_at = now())))
160.          

SubPlan (for Seq Scan)

161. 2.800 2.809 ↓ 2.0 10,003 1

Seq Scan on flow_struct flow_struct_4 (cost=28.20..346.25 rows=5,002 width=4) (actual time=0.019..2.809 rows=10,003 loops=1)

  • Filter: ((hashed SubPlan 39) AND ((deleted_at IS NULL) OR (deleted_at = now())))
162.          

SubPlan (for Seq Scan)

163. 0.009 0.009 ↓ 3.0 3 1

Seq Scan on post_struct post_struct_5 (cost=0.00..28.20 rows=1 width=4) (actual time=0.007..0.009 rows=3 loops=1)

  • Filter: (((deleted_at IS NULL) OR (deleted_at = now())) AND (channel_id = ANY ((current_setting('jwt.claims.channel_creator_for'::text))::integer[])))
164. 0.100 252.700 ↓ 0.0 0 100

WindowAgg (cost=0.00..0.03 rows=1 width=96) (actual time=2.527..2.527 rows=0 loops=100)

165. 252.600 252.600 ↓ 0.0 0 100

CTE Scan on __local_29__ (cost=0.00..0.02 rows=1 width=20) (actual time=2.526..2.526 rows=0 loops=100)

166.          

CTE __local_30__

167. 0.000 253.000 ↑ 1.0 1 100

Aggregate (cost=0.03..0.04 rows=1 width=32) (actual time=2.530..2.530 rows=1 loops=100)

168. 253.000 253.000 ↓ 0.0 0 100

CTE Scan on __local_27__ (cost=0.00..0.02 rows=1 width=24) (actual time=2.530..2.530 rows=0 loops=100)

169.          

Initplan (for Result)

170. 253.100 253.100 ↑ 1.0 1 100

CTE Scan on __local_30__ (cost=0.00..0.02 rows=1 width=32) (actual time=2.531..2.531 rows=1 loops=100)

171.          

CTE __local_32__

172. 0.200 511.100 ↑ 1.0 1 100

Aggregate (cost=0.03..0.04 rows=1 width=32) (actual time=5.111..5.111 rows=1 loops=100)

173. 510.900 510.900 ↑ 1.0 1 100

CTE Scan on __local_25__ (cost=0.00..0.02 rows=1 width=24) (actual time=5.109..5.109 rows=1 loops=100)

174.          

Initplan (for Result)

175. 511.200 511.200 ↑ 1.0 1 100

CTE Scan on __local_32__ (cost=0.00..0.02 rows=1 width=32) (actual time=5.112..5.112 rows=1 loops=100)

176.          

CTE __local_34__

177. 0.300 1,569.400 ↑ 1.0 1 100

Aggregate (cost=2.50..2.51 rows=1 width=32) (actual time=15.694..15.694 rows=1 loops=100)

178. 1,569.100 1,569.100 ↑ 100.0 1 100

CTE Scan on __local_11__ (cost=0.00..2.00 rows=100 width=24) (actual time=3.497..15.691 rows=1 loops=100)

179.          

Initplan (for Result)

180. 1,569.600 1,569.600 ↑ 1.0 1 100

CTE Scan on __local_34__ (cost=0.00..0.02 rows=1 width=32) (actual time=15.695..15.696 rows=1 loops=100)

181. 225.875 229.300 ↓ 0.0 0 100

Seq Scan on block_struct __local_12___2 (cost=361.51..829.61 rows=1,250 width=0) (actual time=2.293..2.293 rows=0 loops=100)

  • Filter: ((hashed SubPlan 64) AND (flow_struct_id = __local_6___1.id) AND ((deleted_at IS NULL) OR (deleted_at = now())) AND (NOT (hashed SubPlan 62)))
  • Rows Removed by Filter: 9903
182.          

SubPlan (for Seq Scan)

183. 3.380 3.394 ↓ 2.0 10,003 1

Seq Scan on flow_struct flow_struct_7 (cost=28.20..346.25 rows=5,002 width=4) (actual time=0.021..3.394 rows=10,003 loops=1)

  • Filter: ((hashed SubPlan 63) AND ((deleted_at IS NULL) OR (deleted_at = now())))
184.          

SubPlan (for Seq Scan)

185. 0.014 0.014 ↓ 3.0 3 1

Seq Scan on post_struct post_struct_8 (cost=0.00..28.20 rows=1 width=4) (actual time=0.011..0.014 rows=3 loops=1)

  • Filter: (((deleted_at IS NULL) OR (deleted_at = now())) AND (channel_id = ANY ((current_setting('jwt.claims.channel_creator_for'::text))::integer[])))
186. 0.031 0.031 ↑ 1.0 100 1

CTE Scan on __local_11__ __local_11___1 (cost=0.00..2.50 rows=100 width=32) (actual time=0.002..0.031 rows=100 loops=1)

187.          

CTE __local_36__

188. 0.348 2,046.894 ↑ 1.0 1 1

Aggregate (cost=2.50..2.51 rows=1 width=32) (actual time=2,046.894..2,046.894 rows=1 loops=1)

189. 2,046.546 2,046.546 ↑ 1.0 100 1

CTE Scan on __local_5__ (cost=0.00..2.00 rows=100 width=24) (actual time=30.694..2,046.546 rows=100 loops=1)

190.          

Initplan (for Result)

191. 2,046.957 2,046.957 ↑ 1.0 1 1

CTE Scan on __local_36__ (cost=0.00..0.02 rows=1 width=32) (actual time=2,046.957..2,046.957 rows=1 loops=1)

192. 0.046 0.107 ↑ 2,501.0 1 1

Seq Scan on flow_struct __local_6___2 (cost=30.95..499.05 rows=2,501 width=0) (actual time=0.106..0.107 rows=1 loops=1)

  • Filter: ((hashed SubPlan 73) AND (post_struct_id = __local_0__.id) AND ((deleted_at IS NULL) OR (deleted_at = now())) AND (NOT (hashed SubPlan 72)))
193.          

SubPlan (for Seq Scan)

194. 0.013 0.013 ↓ 3.0 3 1

Seq Scan on post_struct post_struct_10 (cost=0.00..28.20 rows=1 width=4) (actual time=0.010..0.013 rows=3 loops=1)

  • Filter: (((deleted_at IS NULL) OR (deleted_at = now())) AND (channel_id = ANY ((current_setting('jwt.claims.channel_creator_for'::text))::integer[])))
195. 0.048 0.048 ↑ 1.0 100 1

CTE Scan on __local_5__ __local_5___1 (cost=0.00..2.50 rows=100 width=32) (actual time=0.002..0.048 rows=100 loops=1)

Planning time : 4.381 ms
Execution time : 2,049.256 ms