explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NdbM

Settings
# exclusive inclusive rows x rows loops node
1. 0.466 94.861 ↑ 9.1 22 1

GroupAggregate (cost=36,673.52..36,678.73 rows=200 width=36) (actual time=94.343..94.861 rows=22 loops=1)

  • Group Key: users_accesses.uid
2.          

CTE purchases_assignments_purchase_components

3. 3.263 38.661 ↑ 27.5 3,682 1

Unique (cost=27,655.76..28,416.16 rows=101,386 width=25) (actual time=34.216..38.661 rows=3,682 loops=1)

4. 4.173 35.398 ↑ 17.9 5,670 1

Sort (cost=27,655.76..27,909.23 rows=101,386 width=25) (actual time=34.215..35.398 rows=5,670 loops=1)

  • Sort Key: a.ida, rpuc.idrpuc, rpuc.seller_only DESC
  • Sort Method: quicksort Memory: 635kB
5. 3.591 31.225 ↑ 17.9 5,670 1

Nested Loop (cost=14,360.40..16,796.77 rows=101,386 width=25) (actual time=8.862..31.225 rows=5,670 loops=1)

  • Join Filter: (((rpuc.min_status IS NULL) OR (s.idps > rpuc.min_status)) AND ((rpuc.max_status IS NULL) OR (s.idps < rpuc.max_status)))
  • Rows Removed by Join Filter: 11
6. 2.689 21.953 ↓ 1.1 5,681 1

Hash Join (cost=13,904.61..14,521.90 rows=4,949 width=29) (actual time=7.210..21.953 rows=5,681 loops=1)

  • Hash Cond: (a.idr = rpuc.idr)
7. 1.687 15.212 ↑ 1.2 2,845 1

Hash Join (cost=140.02..682.14 rows=3,426 width=16) (actual time=3.142..15.212 rows=2,845 loops=1)

  • Hash Cond: ("*SELECT* 1".ida = a.ida)
8. 1.036 10.674 ↑ 1.2 2,845 1

Append (cost=1.26..534.37 rows=3,426 width=8) (actual time=0.259..10.674 rows=2,845 loops=1)

9. 0.001 0.019 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1 (cost=1.26..19.64 rows=1 width=8) (actual time=0.019..0.019 rows=0 loops=1)

10. 0.000 0.018 ↓ 0.0 0 1

Nested Loop (cost=1.26..19.63 rows=1 width=8) (actual time=0.018..0.018 rows=0 loops=1)

  • Join Filter: (lots.idp = lot_assignments_programs_lot_tags.idp)
11. 0.001 0.018 ↓ 0.0 0 1

Nested Loop (cost=0.98..17.05 rows=1 width=12) (actual time=0.017..0.018 rows=0 loops=1)

12. 0.001 0.017 ↓ 0.0 0 1

Nested Loop (cost=0.70..16.74 rows=1 width=16) (actual time=0.017..0.017 rows=0 loops=1)

13. 0.006 0.006 ↑ 1.0 1 1

Index Scan using purchases_pkey on purchases (cost=0.41..8.43 rows=1 width=8) (actual time=0.005..0.006 rows=1 loops=1)

  • Index Cond: (idpu = 24363)
14. 0.010 0.010 ↓ 0.0 0 1

Index Only Scan using lots_idl_idp_wid_key on lots (cost=0.29..8.30 rows=1 width=8) (actual time=0.010..0.010 rows=0 loops=1)

  • Index Cond: (idl = purchases.idl)
  • Heap Fetches: 0
15. 0.000 0.000 ↓ 0.0 0

Index Only Scan using lots_tags_pkey on lots_tags lots_tags_2 (cost=0.28..0.31 rows=1 width=8) (never executed)

  • Index Cond: (idl = lots.idl)
  • Heap Fetches: 0
16. 0.000 0.000 ↓ 0.0 0

Index Only Scan using lot_assignments_programs_lot_tags_pkey on lot_assignments_programs_lot_tags (cost=0.27..2.55 rows=2 width=12) (never executed)

  • Index Cond: (idlt = lots_tags_2.idlt)
  • Heap Fetches: 0
17. 0.000 0.014 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2 (cost=0.98..30.56 rows=1 width=8) (actual time=0.014..0.014 rows=0 loops=1)

18. 0.001 0.014 ↓ 0.0 0 1

Nested Loop (cost=0.98..30.55 rows=1 width=8) (actual time=0.013..0.014 rows=0 loops=1)

19. 0.001 0.013 ↓ 0.0 0 1

Nested Loop (cost=0.70..16.74 rows=1 width=8) (actual time=0.013..0.013 rows=0 loops=1)

20. 0.007 0.007 ↑ 1.0 1 1

Index Scan using purchases_pkey on purchases purchases_1 (cost=0.41..8.43 rows=1 width=8) (actual time=0.006..0.007 rows=1 loops=1)

  • Index Cond: (idpu = 24363)
21. 0.005 0.005 ↓ 0.0 0 1

Index Only Scan using lots_idl_idp_wid_key on lots lots_1 (cost=0.29..8.30 rows=1 width=8) (actual time=0.005..0.005 rows=0 loops=1)

  • Index Cond: (idl = purchases_1.idl)
  • Heap Fetches: 0
22. 0.000 0.000 ↓ 0.0 0

Index Only Scan using lot_assignments_programs_pkey on lot_assignments_programs (cost=0.28..13.78 rows=4 width=8) (never executed)

  • Index Cond: (idp = lots_1.idp)
  • Heap Fetches: 0
23. 0.329 3.205 ↓ 3.4 835 1

Subquery Scan on *SELECT* 3 (cost=34.29..154.19 rows=243 width=8) (actual time=0.225..3.205 rows=835 loops=1)

24. 1.315 2.876 ↓ 3.4 835 1

Hash Join (cost=34.29..151.76 rows=243 width=8) (actual time=0.224..2.876 rows=835 loops=1)

  • Hash Cond: (assignments.idr = roles_purchase_components.idr)
25. 1.353 1.353 ↓ 1.0 4,755 1

Seq Scan on assignments (cost=0.00..79.45 rows=4,745 width=8) (actual time=0.004..1.353 rows=4,755 loops=1)

26. 0.018 0.208 ↓ 1.0 53 1

Hash (cost=33.64..33.64 rows=52 width=8) (actual time=0.208..0.208 rows=53 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
27. 0.024 0.190 ↓ 1.0 53 1

Nested Loop (cost=0.41..33.64 rows=52 width=8) (actual time=0.019..0.190 rows=53 loops=1)

28. 0.006 0.006 ↑ 1.0 1 1

Index Scan using purchases_pkey on purchases purchases_2 (cost=0.41..8.43 rows=1 width=4) (actual time=0.005..0.006 rows=1 loops=1)

  • Index Cond: (idpu = 24363)
  • Filter: (idl IS NULL)
29. 0.160 0.160 ↓ 1.0 53 1

Seq Scan on roles_purchase_components (cost=0.00..24.69 rows=52 width=4) (actual time=0.013..0.160 rows=53 loops=1)

  • Filter: include_leads
  • Rows Removed by Filter: 1416
30. 0.001 0.014 ↓ 0.0 0 1

Subquery Scan on *SELECT* 4 (cost=0.98..37.56 rows=1 width=8) (actual time=0.013..0.014 rows=0 loops=1)

31. 0.001 0.013 ↓ 0.0 0 1

Nested Loop (cost=0.98..37.55 rows=1 width=8) (actual time=0.013..0.013 rows=0 loops=1)

32. 0.003 0.012 ↓ 0.0 0 1

Nested Loop (cost=0.70..16.74 rows=1 width=8) (actual time=0.012..0.012 rows=0 loops=1)

33. 0.008 0.008 ↑ 1.0 1 1

Index Scan using purchases_pkey on purchases purchases_3 (cost=0.41..8.43 rows=1 width=8) (actual time=0.008..0.008 rows=1 loops=1)

  • Index Cond: (idpu = 24363)
34. 0.001 0.001 ↓ 0.0 0 1

Index Only Scan using lots_idl_idp_wid_key on lots lots_2 (cost=0.29..8.30 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=1)

  • Index Cond: (idl = purchases_3.idl)
  • Heap Fetches: 0
35. 0.000 0.000 ↓ 0.0 0

Index Only Scan using program_assignments_programs_pkey on program_assignments_programs (cost=0.28..20.77 rows=5 width=8) (never executed)

  • Index Cond: (idp = lots_2.idp)
  • Heap Fetches: 0
36. 0.001 0.026 ↓ 0.0 0 1

Subquery Scan on *SELECT* 5 (cost=8.32..65.84 rows=6 width=8) (actual time=0.026..0.026 rows=0 loops=1)

37. 0.006 0.025 ↓ 0.0 0 1

Hash Join (cost=8.32..65.78 rows=6 width=8) (actual time=0.025..0.025 rows=0 loops=1)

  • Hash Cond: (program_assignments_programs_1.idp = purchases_programs.idp)
38. 0.009 0.009 ↑ 2,724.0 1 1

Seq Scan on program_assignments_programs program_assignments_programs_1 (cost=0.00..50.24 rows=2,724 width=8) (actual time=0.009..0.009 rows=1 loops=1)

39. 0.001 0.010 ↓ 0.0 0 1

Hash (cost=8.31..8.31 rows=1 width=8) (actual time=0.010..0.010 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
40. 0.009 0.009 ↓ 0.0 0 1

Index Only Scan using purchases_programs_pkey on purchases_programs (cost=0.29..8.31 rows=1 width=8) (actual time=0.009..0.009 rows=0 loops=1)

  • Index Cond: (idpu = 24363)
  • Heap Fetches: 0
41. 0.793 6.360 ↑ 1.6 2,010 1

Subquery Scan on *SELECT* 6 (cost=63.14..226.58 rows=3,174 width=8) (actual time=0.994..6.360 rows=2,010 loops=1)

42. 1.015 5.567 ↑ 1.6 2,010 1

Nested Loop (cost=63.14..194.84 rows=3,174 width=8) (actual time=0.993..5.567 rows=2,010 loops=1)

43. 0.011 0.011 ↑ 1.0 1 1

Index Only Scan using purchases_pkey on purchases purchases_4 (cost=0.41..8.43 rows=1 width=4) (actual time=0.009..0.011 rows=1 loops=1)

  • Index Cond: (idpu = 24363)
  • Heap Fetches: 1
44. 2.170 4.541 ↑ 1.6 2,010 1

Hash Join (cost=62.73..154.67 rows=3,174 width=4) (actual time=0.982..4.541 rows=2,010 loops=1)

  • Hash Cond: (a_1.idr = r.idr)
  • Join Filter: ((r.idrt = 1) OR ((r.idrt = ANY ('{2,3}'::integer[])) AND a_1.all_objects))
  • Rows Removed by Join Filter: 2745
45. 1.407 1.407 ↓ 1.0 4,755 1

Seq Scan on assignments a_1 (cost=0.00..79.45 rows=4,745 width=9) (actual time=0.003..1.407 rows=4,755 loops=1)

46. 0.465 0.964 ↓ 1.3 1,590 1

Hash (cost=47.58..47.58 rows=1,212 width=6) (actual time=0.964..0.964 rows=1,590 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 76kB
47. 0.499 0.499 ↓ 1.3 1,590 1

Seq Scan on roles r (cost=0.00..47.58 rows=1,212 width=6) (actual time=0.008..0.499 rows=1,590 loops=1)

  • Filter: ((idrt = 1) OR (idrt = ANY ('{2,3}'::integer[])))
48. 1.429 2.851 ↓ 1.0 4,755 1

Hash (cost=79.45..79.45 rows=4,745 width=12) (actual time=2.851..2.851 rows=4,755 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 269kB
49. 1.422 1.422 ↓ 1.0 4,755 1

Seq Scan on assignments a (cost=0.00..79.45 rows=4,745 width=12) (actual time=0.006..1.422 rows=4,755 loops=1)

50. 0.488 4.052 ↑ 1.0 1,468 1

Hash (cost=13,746.24..13,746.24 rows=1,468 width=21) (actual time=4.052..4.052 rows=1,468 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 91kB
51. 0.815 3.564 ↑ 1.0 1,468 1

Nested Loop (cost=0.41..13,746.24 rows=1,468 width=21) (actual time=0.012..3.564 rows=1,468 loops=1)

  • Join Filter: ((NOT rpuc.uses_lot_tags) OR (alternatives: SubPlan 1 or hashed SubPlan 2))
  • Rows Removed by Join Filter: 1
52. 0.008 0.008 ↑ 1.0 1 1

Index Scan using purchases_pkey on purchases pu (cost=0.41..8.43 rows=1 width=12) (actual time=0.007..0.008 rows=1 loops=1)

  • Index Cond: (idpu = 24363)
53. 0.444 0.444 ↑ 1.0 1,469 1

Seq Scan on roles_purchase_components rpuc (cost=0.00..24.69 rows=1,469 width=14) (actual time=0.003..0.444 rows=1,469 loops=1)

54.          

SubPlan (for Nested Loop)

55. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..9.32 rows=1 width=0) (never executed)

  • Join Filter: (lots_tags.idlt = roles_purchase_components_lot_tags.idlt)
56. 0.000 0.000 ↓ 0.0 0

Index Only Scan using lots_tags_pkey on lots_tags (cost=0.28..8.30 rows=1 width=4) (never executed)

  • Index Cond: (idl = pu.idl)
  • Heap Fetches: 0
57. 0.000 0.000 ↓ 0.0 0

Seq Scan on roles_purchase_components_lot_tags (cost=0.00..1.01 rows=1 width=2) (never executed)

  • Filter: (idrpuc = rpuc.idrpuc)
58. 1.229 2.297 ↓ 48.6 437 1

Hash Join (cost=1.02..89.88 rows=9 width=8) (actual time=0.074..2.297 rows=437 loops=1)

  • Hash Cond: (lots_tags_1.idlt = roles_purchase_components_lot_tags_1.idlt)
59. 1.061 1.061 ↑ 1.0 4,708 1

Seq Scan on lots_tags lots_tags_1 (cost=0.00..71.10 rows=4,710 width=8) (actual time=0.006..1.061 rows=4,708 loops=1)

60. 0.003 0.007 ↑ 1.0 1 1

Hash (cost=1.01..1.01 rows=1 width=6) (actual time=0.006..0.007 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
61. 0.004 0.004 ↑ 1.0 1 1

Seq Scan on roles_purchase_components_lot_tags roles_purchase_components_lot_tags_1 (cost=0.00..1.01 rows=1 width=6) (actual time=0.003..0.004 rows=1 loops=1)

62. 4.034 5.681 ↑ 21.0 1 5,681

Materialize (cost=455.79..456.16 rows=21 width=8) (actual time=0.000..0.001 rows=1 loops=5,681)

63. 0.001 1.647 ↑ 21.0 1 1

Subquery Scan on s (cost=455.79..456.06 rows=21 width=8) (actual time=1.646..1.647 rows=1 loops=1)

64. 0.002 1.646 ↑ 21.0 1 1

Unique (cost=455.79..455.85 rows=21 width=103) (actual time=1.644..1.646 rows=1 loops=1)

65. 0.011 1.644 ↑ 10.5 2 1

Sort (cost=455.79..455.85 rows=21 width=103) (actual time=1.643..1.644 rows=2 loops=1)

  • Sort Key: "*SELECT* 1_1"."?column?" DESC, (0) DESC, st.caption DESC
  • Sort Method: quicksort Memory: 25kB
66. 0.012 1.633 ↑ 10.5 2 1

Sort (cost=455.07..455.12 rows=21 width=103) (actual time=1.632..1.633 rows=2 loops=1)

  • Sort Key: "*SELECT* 1_1"."?column?", st.caption
  • Sort Method: quicksort Memory: 25kB
67. 0.013 1.621 ↑ 10.5 2 1

Hash Join (cost=71.67..454.61 rows=21 width=103) (actual time=1.445..1.621 rows=2 loops=1)

  • Hash Cond: ("*SELECT* 1_1"."?column?" = st.idps)
68. 0.010 1.585 ↑ 10.5 2 1

Nested Loop (cost=68.20..451.07 rows=21 width=8) (actual time=1.410..1.585 rows=2 loops=1)

69. 0.007 1.401 ↑ 1.0 1 1

Nested Loop Left Join (cost=68.19..450.07 rows=1 width=2,545) (actual time=1.397..1.401 rows=1 loops=1)

  • Join Filter: (pd_2.idpu = p.idpu)
70. 0.003 1.379 ↑ 1.0 1 1

Nested Loop Left Join (cost=51.42..432.99 rows=1 width=187) (actual time=1.375..1.379 rows=1 loops=1)

  • Join Filter: (pd_1.idpu = p.idpu)
71. 0.001 1.360 ↑ 1.0 1 1

Nested Loop Left Join (cost=26.34..407.86 rows=1 width=155) (actual time=1.357..1.360 rows=1 loops=1)

  • Join Filter: (opr.idpu = p.idpu)
72. 0.004 1.351 ↑ 1.0 1 1

Nested Loop Left Join (cost=26.34..406.69 rows=1 width=147) (actual time=1.348..1.351 rows=1 loops=1)

  • Join Filter: (p.idpu = pd.idpu)
73. 0.003 1.327 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.98..372.73 rows=1 width=147) (actual time=1.324..1.327 rows=1 loops=1)

  • Join Filter: (p.idpu = purchases_loan_conditions.idpu)
74. 0.002 0.028 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.98..17.05 rows=1 width=135) (actual time=0.026..0.028 rows=1 loops=1)

  • Join Filter: (p.wid = pr.wid)
75. 0.004 0.018 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.70..16.74 rows=1 width=124) (actual time=0.016..0.018 rows=1 loops=1)

76. 0.010 0.010 ↑ 1.0 1 1

Index Scan using purchases_pkey on purchases p (cost=0.41..8.43 rows=1 width=124) (actual time=0.008..0.010 rows=1 loops=1)

  • Index Cond: (idpu = 24363)
77. 0.004 0.004 ↓ 0.0 0 1

Index Scan using lots_wid_idl_key on lots l (cost=0.29..8.31 rows=1 width=12) (actual time=0.004..0.004 rows=0 loops=1)

  • Index Cond: ((p.wid = wid) AND (p.idl = idl))
78. 0.008 0.008 ↓ 0.0 0 1

Index Scan using programs_pkey on programs pr (cost=0.28..0.30 rows=1 width=27) (actual time=0.008..0.008 rows=0 loops=1)

  • Index Cond: (l.idp = idp)
79. 0.002 1.296 ↓ 0.0 0 1

GroupAggregate (cost=0.00..355.66 rows=1 width=84) (actual time=1.295..1.296 rows=0 loops=1)

  • Group Key: purchases_loan_conditions.idpu
80. 1.294 1.294 ↓ 0.0 0 1

Seq Scan on purchases_loan_conditions (cost=0.00..355.64 rows=1 width=12) (actual time=1.294..1.294 rows=0 loops=1)

  • Filter: (idpu = 24363)
  • Rows Removed by Filter: 14861
81. 0.000 0.020 ↓ 0.0 0 1

GroupAggregate (cost=25.36..33.94 rows=1 width=178) (actual time=0.020..0.020 rows=0 loops=1)

  • Group Key: pd.idpu
82. 0.001 0.020 ↓ 0.0 0 1

Nested Loop Left Join (cost=25.36..33.42 rows=1 width=95) (actual time=0.020..0.020 rows=0 loops=1)

83. 0.001 0.019 ↓ 0.0 0 1

GroupAggregate (cost=25.08..25.10 rows=1 width=346) (actual time=0.019..0.019 rows=0 loops=1)

  • Group Key: pd.idpud
84. 0.008 0.018 ↓ 0.0 0 1

Sort (cost=25.08..25.09 rows=1 width=49) (actual time=0.018..0.018 rows=0 loops=1)

  • Sort Key: pd.idpud
  • Sort Method: quicksort Memory: 25kB
85. 0.000 0.010 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.97..25.07 rows=1 width=49) (actual time=0.010..0.010 rows=0 loops=1)

86. 0.001 0.010 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.70..16.76 rows=1 width=48) (actual time=0.009..0.010 rows=0 loops=1)

87. 0.009 0.009 ↓ 0.0 0 1

Index Scan using purchase_documents_idpu_idsdt_key on purchase_documents pd (cost=0.29..8.30 rows=1 width=48) (actual time=0.009..0.009 rows=0 loops=1)

  • Index Cond: (idpu = 24363)
88. 0.000 0.000 ↓ 0.0 0

Index Scan using purchase_users_documents_pkey on purchase_documents_users pdu (cost=0.41..8.45 rows=1 width=12) (never executed)

  • Index Cond: ((pd.idpu = idpu) AND (idpu = 24363) AND (pd.idpud = idpud))
89. 0.000 0.000 ↓ 0.0 0

Index Scan using document_models_pkey on document_models dm_1 (cost=0.28..8.29 rows=1 width=5) (never executed)

  • Index Cond: (pd.iddm = iddm)
90. 0.000 0.000 ↓ 0.0 0

Index Scan using document_models_pkey on document_models dm (cost=0.28..8.29 rows=1 width=58) (never executed)

  • Index Cond: (pd.iddm = iddm)
91. 0.008 0.008 ↓ 0.0 0 1

Seq Scan on options_requests opr (cost=0.00..1.15 rows=1 width=12) (actual time=0.008..0.008 rows=0 loops=1)

  • Filter: ((refused IS NULL) AND (idpu = 24363))
  • Rows Removed by Filter: 20
92. 0.000 0.016 ↓ 0.0 0 1

GroupAggregate (cost=25.08..25.11 rows=1 width=346) (actual time=0.016..0.016 rows=0 loops=1)

  • Group Key: pd_1.idpud
93. 0.007 0.016 ↓ 0.0 0 1

Sort (cost=25.08..25.09 rows=1 width=48) (actual time=0.016..0.016 rows=0 loops=1)

  • Sort Key: pd_1.idpud
  • Sort Method: quicksort Memory: 25kB
94. 0.001 0.009 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.99..25.07 rows=1 width=48) (actual time=0.008..0.009 rows=0 loops=1)

95. 0.001 0.008 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.70..16.77 rows=1 width=36) (actual time=0.008..0.008 rows=0 loops=1)

96. 0.007 0.007 ↓ 0.0 0 1

Index Scan using purchase_documents_idpu_idsdt_key on purchase_documents pd_1 (cost=0.29..8.31 rows=1 width=28) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: ((idpu = 24363) AND (idsdt = 1))
97. 0.000 0.000 ↓ 0.0 0

Index Scan using purchase_users_documents_pkey on purchase_documents_users pdu_1 (cost=0.41..8.45 rows=1 width=20) (never executed)

  • Index Cond: ((pd_1.idpu = idpu) AND (idpu = 24363) AND (pd_1.idpud = idpud))
98. 0.000 0.000 ↓ 0.0 0

Index Scan using ll_legal_notices_pkey on ll_legal_notices ln (cost=0.29..8.31 rows=1 width=20) (never executed)

  • Index Cond: (pdu_1.idln = idln)
99. 0.000 0.015 ↓ 0.0 0 1

GroupAggregate (cost=16.78..16.80 rows=1 width=346) (actual time=0.015..0.015 rows=0 loops=1)

  • Group Key: pd_2.idpud
100. 0.006 0.015 ↓ 0.0 0 1

Sort (cost=16.78..16.78 rows=1 width=16) (actual time=0.014..0.015 rows=0 loops=1)

  • Sort Key: pd_2.idpud
  • Sort Method: quicksort Memory: 25kB
101. 0.001 0.009 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.70..16.77 rows=1 width=16) (actual time=0.009..0.009 rows=0 loops=1)

102. 0.008 0.008 ↓ 0.0 0 1

Index Scan using purchase_documents_idpu_idsdt_key on purchase_documents pd_2 (cost=0.29..8.31 rows=1 width=12) (actual time=0.008..0.008 rows=0 loops=1)

  • Index Cond: ((idpu = 24363) AND (idsdt = 2))
103. 0.000 0.000 ↓ 0.0 0

Index Scan using purchase_users_documents_pkey on purchase_documents_users pdu_2 (cost=0.41..8.45 rows=1 width=20) (never executed)

  • Index Cond: ((pd_2.idpu = idpu) AND (idpu = 24363) AND (pd_2.idpud = idpud))
104. 0.013 0.174 ↑ 10.5 2 1

Append (cost=0.01..0.78 rows=21 width=4) (actual time=0.005..0.174 rows=2 loops=1)

105. 0.001 0.002 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1_1 (cost=0.01..0.03 rows=1 width=4) (actual time=0.001..0.002 rows=0 loops=1)

106. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.01..0.01 rows=1 width=12) (actual time=0.001..0.001 rows=0 loops=1)

  • One-Time Filter: ((p.lead_claimed_on IS NOT NULL) AND (p.lead_claimed_on <= now()))
107. 0.001 0.003 ↑ 1.0 1 1

Subquery Scan on *SELECT* 2_1 (cost=0.01..0.03 rows=1 width=4) (actual time=0.002..0.003 rows=1 loops=1)

108. 0.002 0.002 ↑ 1.0 1 1

Result (cost=0.01..0.01 rows=1 width=12) (actual time=0.001..0.002 rows=1 loops=1)

  • One-Time Filter: ((p.lead_created_on IS NOT NULL) AND (p.lead_created_on <= now()))
109. 0.000 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 3_1 (cost=0.01..0.03 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=1)

110. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.01..0.01 rows=1 width=12) (actual time=0.000..0.001 rows=0 loops=1)

  • One-Time Filter: ((p.claimed_lead_confirmed IS NOT NULL) AND (p.claimed_lead_confirmed <= now()))
111. 0.001 0.002 ↑ 1.0 1 1

Subquery Scan on *SELECT* 4_1 (cost=0.01..0.03 rows=1 width=4) (actual time=0.001..0.002 rows=1 loops=1)

112. 0.001 0.001 ↑ 1.0 1 1

Result (cost=0.01..0.01 rows=1 width=12) (actual time=0.001..0.001 rows=1 loops=1)

  • One-Time Filter: ((p.interest_confirmed_date IS NOT NULL) AND (p.interest_confirmed_date <= now()))
113. 0.000 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 5_1 (cost=0.01..0.03 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=1)

114. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.01..0.01 rows=1 width=12) (actual time=0.000..0.001 rows=0 loops=1)

  • One-Time Filter: ((opr.created IS NOT NULL) AND (opr.created <= now()))
115. 0.000 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 6_1 (cost=0.01..0.03 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=1)

116. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.01..0.01 rows=1 width=12) (actual time=0.000..0.001 rows=0 loops=1)

  • One-Time Filter: ((p.lot_assignment_date IS NOT NULL) AND (p.lot_assignment_date <= now()))
117. 0.001 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 7 (cost=0.01..0.03 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=1)

118. 0.000 0.000 ↓ 0.0 0 1

Result (cost=0.01..0.01 rows=1 width=12) (actual time=0.000..0.000 rows=0 loops=1)

  • One-Time Filter: (((CASE WHEN (NOT bool_or((pdu_1.signed_date IS NULL))) THEN max(pdu_1.signed_date) ELSE NULL::timestamp with time zone END) IS NOT NULL) AND ((CASE WHEN (NOT bool_or((pdu_1.signed_date IS NULL))) THEN max(pdu_1.signed_date) ELSE NULL::timestamp with time zone END) <= now()))
119. 0.000 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 8 (cost=0.01..0.03 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=1)

120. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.01..0.01 rows=1 width=12) (actual time=0.000..0.001 rows=0 loops=1)

  • One-Time Filter: (((CASE WHEN (NOT bool_or((pdu_2.signed_date IS NULL))) THEN max(pdu_2.signed_date) ELSE NULL::timestamp with time zone END) IS NOT NULL) AND ((CASE WHEN (NOT bool_or((pdu_2.signed_date IS NULL))) THEN max(pdu_2.signed_date) ELSE NULL::timestamp with time zone END) <= now()))
121. 0.000 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 9 (cost=0.01..0.03 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=1)

122. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.01..0.01 rows=1 width=12) (actual time=0.001..0.001 rows=0 loops=1)

  • One-Time Filter: (((CASE WHEN pr.assume_documents_signed THEN p.lot_assignment_date ELSE pd_1.developer_signed_date END) IS NOT NULL) AND ((CASE WHEN pr.assume_documents_signed THEN p.lot_assignment_date ELSE pd_1.developer_signed_date END) <= now()))
123. 0.000 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 10 (cost=0.01..0.03 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=1)

124. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.01..0.01 rows=1 width=12) (actual time=0.001..0.001 rows=0 loops=1)

  • One-Time Filter: (((CASE WHEN ((pd_2.idpud IS NOT NULL) AND ((CASE WHEN (NOT bool_or((pdu_2.signed_date IS NULL))) THEN max(pdu_2.signed_date) ELSE NULL::timestamp with time zone END) IS NOT NULL)) THEN pd_1.added_date ELSE NULL::timestamp with time zone END) IS NOT NULL) AND ((CASE WHEN ((pd_2.idpud IS NOT NULL) AND ((CASE WHEN (NOT bool_or((pdu_2.signed_date IS NULL))) THEN max(pdu_2.signed_date) ELSE NULL::timestamp with time zone END) IS NOT NULL)) THEN pd_1.added_date ELSE NULL::timestamp with time zone END) <= now()))
125. 0.000 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 11 (cost=0.01..0.03 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=1)

126. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.01..0.01 rows=1 width=12) (actual time=0.000..0.001 rows=0 loops=1)

  • One-Time Filter: (pr.activate_sru_steps AND ((CASE WHEN bool_and(((ln.received IS NOT NULL) AND (ln.voided IS NULL))) THEN max(ln.received) ELSE NULL::timestamp with time zone END) IS NOT NULL) AND ((CASE WHEN bool_and(((ln.received IS NOT NULL) AND (ln.voided IS NULL))) THEN max(ln.received) ELSE NULL::timestamp with time zone END) <= now()))
127. 0.000 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 12 (cost=0.01..0.03 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=1)

128. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.01..0.01 rows=1 width=12) (actual time=0.000..0.001 rows=0 loops=1)

  • One-Time Filter: (((CASE WHEN pr.assume_documents_signed THEN p.lot_assignment_date WHEN pr.activate_sru_steps THEN ((CASE WHEN bool_and(((ln.received IS NOT NULL) AND (ln.voided IS NULL))) THEN max(ln.received) ELSE NULL::timestamp with time zone END) + '11 days'::interval day) ELSE pd_1.developer_signed_date END) IS NOT NULL) AND ((CASE WHEN pr.assume_documents_signed THEN p.lot_assignment_date WHEN pr.activate_sru_steps THEN ((CASE WHEN bool_and(((ln.received IS NOT NULL) AND (ln.voided IS NULL))) THEN max(ln.received) ELSE NULL::timestamp with time zone END) + '11 days'::interval day) ELSE pd_1.developer_signed_date END) <= now()))
129. 0.001 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 13 (cost=0.01..0.03 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=1)

130. 0.000 0.000 ↓ 0.0 0 1

Result (cost=0.01..0.01 rows=1 width=12) (actual time=0.000..0.000 rows=0 loops=1)

  • One-Time Filter: (((CASE WHEN pr.suppose_loans_granted THEN (CASE WHEN pr.assume_documents_signed THEN p.lot_assignment_date WHEN pr.activate_sru_steps THEN ((CASE WHEN bool_and(((ln.received IS NOT NULL) AND (ln.voided IS NULL))) THEN max(ln.received) ELSE NULL::timestamp with time zone END) + '11 days'::interval day) ELSE pd_1.developer_signed_date END + pr.funding_wait_duration) WHEN (purchases_loan_conditions.idpu IS NOT NULL) THEN strict_greatest(VARIADIC ARRAY[GREATEST(p.assume_loan_offer_uploaded, (CASE WHEN bool_and((purchases_loan_conditions.offer_uploaded IS NOT NULL)) THEN max(purchases_loan_conditions.offer_uploaded) ELSE NULL::timestamp with time zone END)), CASE WHEN pr.assume_documents_signed THEN p.lot_assignment_date WHEN pr.activate_sru_steps THEN ((CASE WHEN bool_and(((ln.received IS NOT NULL) AND (ln.voided IS NULL))) THEN max(ln.received) ELSE NULL::timestamp with time zone END) + '11 days'::interval day) ELSE pd_1.developer_signed_date END]) ELSE CASE WHEN pr.assume_documents_signed THEN p.lot_assignment_date WHEN pr.activate_sru_steps THEN ((CASE WHEN bool_and(((ln.received IS NOT NULL) AND (ln.voided IS NULL))) THEN max(ln.received) ELSE NULL::timestamp with time zone END) + '11 days'::interval day) ELSE pd_1.developer_signed_date END END) IS NOT NULL) AND ((CASE WHEN pr.suppose_loans_granted THEN (CASE WHEN pr.assume_documents_signed THEN p.lot_assignment_date WHEN pr.activate_sru_steps THEN ((CASE WHEN bool_and(((ln.received IS NOT NULL) AND (ln.voided IS NULL))) THEN max(ln.received) ELSE NULL::timestamp with time zone END) + '11 days'::interval day) ELSE pd_1.developer_signed_date END + pr.funding_wait_duration) WHEN (purchases_loan_conditions.idpu IS NOT NULL) THEN strict_greatest(VARIADIC ARRAY[GREATEST(p.assume_loan_offer_uploaded, (CASE WHEN bool_and((purchases_loan_conditions.offer_uploaded IS NOT NULL)) THEN max(purchases_loan_conditions.offer_uploaded) ELSE NULL::timestamp with time zone END)), CASE WHEN pr.assume_documents_signed THEN p.lot_assignment_date WHEN pr.activate_sru_steps THEN ((CASE WHEN bool_and(((ln.received IS NOT NULL) AND (ln.voided IS NULL))) THEN max(ln.received) ELSE NULL::timestamp with time zone END) + '11 days'::interval day) ELSE pd_1.developer_signed_date END]) ELSE CASE WHEN pr.assume_documents_signed THEN p.lot_assignment_date WHEN pr.activate_sru_steps THEN ((CASE WHEN bool_and(((ln.received IS NOT NULL) AND (ln.voided IS NULL))) THEN max(ln.received) ELSE NULL::timestamp with time zone END) + '11 days'::interval day) ELSE pd_1.developer_signed_date END END) <= now()))
131. 0.001 0.137 ↓ 0.0 0 1

Subquery Scan on *SELECT* 14 (cost=0.00..0.28 rows=1 width=4) (actual time=0.137..0.137 rows=0 loops=1)

  • Filter: (("*SELECT* 14".strict_greatest IS NOT NULL) AND ("*SELECT* 14".strict_greatest <= now()))
  • Rows Removed by Filter: 1
132. 0.136 0.136 ↑ 1.0 1 1

Result (cost=0.00..0.26 rows=1 width=12) (actual time=0.135..0.136 rows=1 loops=1)

133. 0.000 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 15 (cost=0.01..0.03 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=1)

134. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.01..0.01 rows=1 width=12) (actual time=0.000..0.001 rows=0 loops=1)

  • One-Time Filter: ((p.bill_date IS NOT NULL) AND (p.bill_date <= now()))
135. 0.001 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 16 (cost=0.01..0.03 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=1)

136. 0.000 0.000 ↓ 0.0 0 1

Result (cost=0.01..0.01 rows=1 width=12) (actual time=0.000..0.000 rows=0 loops=1)

  • One-Time Filter: ((p.delivery IS NOT NULL) AND (p.delivery <= now()))
137. 0.000 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 17 (cost=0.01..0.03 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=1)

138. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.01..0.01 rows=1 width=12) (actual time=0.000..0.001 rows=0 loops=1)

  • One-Time Filter: ((p.ddt_transmission IS NOT NULL) AND (p.ddt_transmission <= now()))
139. 0.000 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 18 (cost=0.01..0.03 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=1)

140. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.01..0.01 rows=1 width=12) (actual time=0.000..0.001 rows=0 loops=1)

  • One-Time Filter: ((p.option_exercised IS NOT NULL) AND (p.option_exercised <= now()))
141. 0.001 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 19 (cost=0.01..0.03 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=1)

142. 0.000 0.000 ↓ 0.0 0 1

Result (cost=0.01..0.01 rows=1 width=12) (actual time=0.000..0.000 rows=0 loops=1)

  • One-Time Filter: ((p.is_suspect_since IS NOT NULL) AND (p.is_suspect_since <= now()))
143. 0.001 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 20 (cost=0.01..0.03 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=1)

144. 0.000 0.000 ↓ 0.0 0 1

Result (cost=0.01..0.01 rows=1 width=12) (actual time=0.000..0.000 rows=0 loops=1)

  • One-Time Filter: ((p.cancelled_date IS NOT NULL) AND (p.cancelled_date <= now()))
145. 0.000 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 21 (cost=0.01..0.03 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=1)

146. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.01..0.01 rows=1 width=12) (actual time=0.000..0.001 rows=0 loops=1)

  • One-Time Filter: ((p.claimed_lead_rejected IS NOT NULL) AND (p.claimed_lead_rejected <= now()))
147. 0.011 0.023 ↑ 1.0 21 1

Hash (cost=3.21..3.21 rows=21 width=17) (actual time=0.023..0.023 rows=21 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
148. 0.012 0.012 ↑ 1.0 21 1

Seq Scan on statuses st (cost=0.00..3.21 rows=21 width=17) (actual time=0.005..0.012 rows=21 loops=1)

149.          

CTE whitelabels_purchase_accesses

150. 0.024 47.743 ↓ 1.9 62 1

Append (cost=0.41..3,167.43 rows=32 width=10) (actual time=0.018..47.743 rows=62 loops=1)

151. 0.015 0.039 ↓ 1.2 31 1

Nested Loop (cost=0.41..9.95 rows=26 width=10) (actual time=0.017..0.039 rows=31 loops=1)

152. 0.012 0.012 ↑ 1.0 1 1

Index Only Scan using purchases_pkey on purchases purchases_5 (cost=0.41..8.43 rows=1 width=4) (actual time=0.011..0.012 rows=1 loops=1)

  • Index Cond: (idpu = 24363)
  • Heap Fetches: 1
153. 0.012 0.012 ↓ 1.2 31 1

Seq Scan on purchase_accesses (cost=0.00..1.26 rows=26 width=2) (actual time=0.005..0.012 rows=31 loops=1)

154. 0.069 5.382 ↓ 10.3 31 1

Nested Loop (cost=0.97..849.31 rows=3 width=10) (actual time=1.814..5.382 rows=31 loops=1)

  • Join Filter: ((1) = pa.idat)
  • Rows Removed by Join Filter: 155
155. 0.012 0.012 ↓ 1.2 31 1

Seq Scan on purchase_accesses pa (cost=0.00..1.26 rows=26 width=4) (actual time=0.002..0.012 rows=31 loops=1)

156. 0.056 5.301 ↑ 3.3 6 31

Materialize (cost=0.97..840.30 rows=20 width=12) (actual time=0.001..0.171 rows=6 loops=31)

157. 0.006 5.245 ↑ 3.3 6 1

Nested Loop (cost=0.97..840.20 rows=20 width=12) (actual time=0.024..5.245 rows=6 loops=1)

  • Join Filter: (purchases_6.wid = ll_whitelabels.wid)
158. 0.002 0.017 ↑ 1.0 1 1

Nested Loop (cost=0.69..16.74 rows=1 width=12) (actual time=0.016..0.017 rows=1 loops=1)

159. 0.008 0.008 ↑ 1.0 1 1

Index Scan using purchases_pkey on purchases purchases_6 (cost=0.41..8.43 rows=1 width=8) (actual time=0.007..0.008 rows=1 loops=1)

  • Index Cond: (idpu = 24363)
160. 0.007 0.007 ↑ 1.0 1 1

Index Only Scan using idx_39390_primary on ll_whitelabels w (cost=0.28..8.29 rows=1 width=4) (actual time=0.007..0.007 rows=1 loops=1)

  • Index Cond: (wid = purchases_6.wid)
  • Heap Fetches: 1
161. 0.007 5.222 ↑ 1.8 6 1

Append (cost=0.28..823.32 rows=11 width=8) (actual time=0.006..5.222 rows=6 loops=1)

162. 0.006 0.006 ↑ 1.0 1 1

Index Only Scan using idx_39390_primary on ll_whitelabels (cost=0.28..0.51 rows=1 width=8) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: (wid = w.wid)
  • Heap Fetches: 1
163. 0.001 0.002 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2_2 (cost=0.00..0.02 rows=1 width=8) (actual time=0.001..0.002 rows=0 loops=1)

  • Filter: (w.wid = "*SELECT* 2_2"."?column?")
  • Rows Removed by Filter: 1
164. 0.001 0.001 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=8) (actual time=0.000..0.001 rows=1 loops=1)

165. 0.005 0.437 ↓ 0.0 0 1

Subquery Scan on *SELECT* 3_2 (cost=0.00..88.06 rows=1 width=8) (actual time=0.437..0.437 rows=0 loops=1)

  • Filter: (w.wid = "*SELECT* 3_2".wid)
  • Rows Removed by Filter: 20
166. 0.432 0.432 ↑ 1.0 20 1

Seq Scan on ll_whitelabels ll_whitelabels_1 (cost=0.00..87.81 rows=20 width=8) (actual time=0.045..0.432 rows=20 loops=1)

  • Filter: enable_documents
  • Rows Removed by Filter: 1456
167. 0.003 0.400 ↓ 0.0 0 1

Subquery Scan on *SELECT* 4_2 (cost=0.00..87.91 rows=1 width=8) (actual time=0.400..0.400 rows=0 loops=1)

  • Filter: (w.wid = "*SELECT* 4_2".wid)
  • Rows Removed by Filter: 8
168. 0.397 0.397 ↑ 1.0 8 1

Seq Scan on ll_whitelabels ll_whitelabels_2 (cost=0.00..87.81 rows=8 width=8) (actual time=0.027..0.397 rows=8 loops=1)

  • Filter: enable_packs
  • Rows Removed by Filter: 1468
169. 0.299 0.963 ↑ 1.0 1 1

Subquery Scan on *SELECT* 5_2 (cost=0.00..106.03 rows=1 width=8) (actual time=0.940..0.963 rows=1 loops=1)

  • Filter: (w.wid = "*SELECT* 5_2".wid)
  • Rows Removed by Filter: 1452
170. 0.664 0.664 ↑ 1.0 1,453 1

Seq Scan on ll_whitelabels ll_whitelabels_3 (cost=0.00..87.81 rows=1,458 width=8) (actual time=0.003..0.664 rows=1,453 loops=1)

  • Filter: enable_re
  • Rows Removed by Filter: 23
171. 0.009 0.460 ↑ 1.0 1 1

Subquery Scan on *SELECT* 6_2 (cost=0.00..88.34 rows=1 width=8) (actual time=0.445..0.460 rows=1 loops=1)

  • Filter: (w.wid = "*SELECT* 6_2".wid)
  • Rows Removed by Filter: 40
172. 0.451 0.451 ↑ 1.0 41 1

Seq Scan on ll_whitelabels ll_whitelabels_4 (cost=0.00..87.81 rows=42 width=8) (actual time=0.105..0.451 rows=41 loops=1)

  • Filter: enable_re_ads
  • Rows Removed by Filter: 1435
173. 0.001 0.447 ↓ 0.0 0 1

Subquery Scan on *SELECT* 7_1 (cost=0.00..87.84 rows=1 width=8) (actual time=0.447..0.447 rows=0 loops=1)

  • Filter: (w.wid = "*SELECT* 7_1".wid)
  • Rows Removed by Filter: 2
174. 0.446 0.446 ↑ 1.0 2 1

Seq Scan on ll_whitelabels ll_whitelabels_5 (cost=0.00..87.81 rows=2 width=8) (actual time=0.151..0.446 rows=2 loops=1)

  • Filter: enable_anonymous_documents
  • Rows Removed by Filter: 1474
175. 0.026 0.542 ↑ 1.0 1 1

Subquery Scan on *SELECT* 8_1 (cost=0.00..89.32 rows=1 width=8) (actual time=0.525..0.542 rows=1 loops=1)

  • Filter: (w.wid = "*SELECT* 8_1".wid)
  • Rows Removed by Filter: 120
176. 0.516 0.516 ↑ 1.0 121 1

Seq Scan on ll_whitelabels ll_whitelabels_6 (cost=0.00..87.81 rows=121 width=8) (actual time=0.002..0.516 rows=121 loops=1)

  • Filter: enable_crm
  • Rows Removed by Filter: 1355
177. 0.001 0.433 ↓ 0.0 0 1

Subquery Scan on *SELECT* 9_1 (cost=0.00..87.84 rows=1 width=8) (actual time=0.433..0.433 rows=0 loops=1)

  • Filter: (w.wid = "*SELECT* 9_1".wid)
  • Rows Removed by Filter: 2
178. 0.432 0.432 ↑ 1.0 2 1

Seq Scan on ll_whitelabels ll_whitelabels_7 (cost=0.00..87.81 rows=2 width=8) (actual time=0.183..0.432 rows=2 loops=1)

  • Filter: enable_re_superadmin
  • Rows Removed by Filter: 1474
179. 0.100 0.747 ↑ 1.0 1 1

Subquery Scan on *SELECT* 10_1 (cost=0.00..93.75 rows=1 width=8) (actual time=0.727..0.747 rows=1 loops=1)

  • Filter: (w.wid = "*SELECT* 10_1".wid)
  • Rows Removed by Filter: 473
180. 0.647 0.647 ↑ 1.0 474 1

Seq Scan on ll_whitelabels ll_whitelabels_8 (cost=0.00..87.81 rows=475 width=8) (actual time=0.002..0.647 rows=474 loops=1)

  • Filter: enable_re_lot_explorer
  • Rows Removed by Filter: 1002
181. 0.101 0.778 ↑ 1.0 1 1

Subquery Scan on *SELECT* 11_1 (cost=0.00..93.71 rows=1 width=8) (actual time=0.758..0.778 rows=1 loops=1)

  • Filter: (w.wid = "*SELECT* 11_1".wid)
  • Rows Removed by Filter: 471
182. 0.677 0.677 ↑ 1.0 472 1

Seq Scan on ll_whitelabels ll_whitelabels_9 (cost=0.00..87.81 rows=472 width=8) (actual time=0.002..0.677 rows=472 loops=1)

  • Filter: enable_external
  • Rows Removed by Filter: 1004
183. 0.001 42.298 ↓ 0.0 0 1

Unique (cost=2,307.83..2,307.85 rows=3 width=10) (actual time=42.298..42.298 rows=0 loops=1)

184. 0.007 42.297 ↓ 0.0 0 1

Sort (cost=2,307.83..2,307.84 rows=3 width=10) (actual time=42.297..42.297 rows=0 loops=1)

  • Sort Key: aw.target_wid, roles_purchase_components_accesses.idpua
  • Sort Method: quicksort Memory: 25kB
185. 0.001 42.290 ↓ 0.0 0 1

Nested Loop (cost=1.39..2,307.81 rows=3 width=10) (actual time=42.290..42.290 rows=0 loops=1)

186. 0.118 42.289 ↓ 0.0 0 1

Nested Loop (cost=1.11..2,307.31 rows=1 width=12) (actual time=42.289..42.289 rows=0 loops=1)

  • Join Filter: ((NOT purchases_assignments_purchase_components.seller_only) OR (aw.target_wid = seller.wid))
  • Rows Removed by Join Filter: 16
187. 0.084 42.001 ↓ 85.0 170 1

Nested Loop Left Join (cost=0.84..2,306.22 rows=2 width=17) (actual time=34.445..42.001 rows=170 loops=1)

188. 0.892 41.577 ↓ 85.0 170 1

Nested Loop (cost=0.41..2,295.95 rows=2 width=17) (actual time=34.432..41.577 rows=170 loops=1)

  • Join Filter: (pu_1.wid = purchases_assignments_purchase_components.wid)
  • Rows Removed by Join Filter: 3512
189. 0.010 0.010 ↑ 1.0 1 1

Index Scan using purchases_pkey on purchases pu_1 (cost=0.41..8.43 rows=1 width=8) (actual time=0.008..0.010 rows=1 loops=1)

  • Index Cond: (idpu = 24363)
190. 40.675 40.675 ↓ 7.3 3,682 1

CTE Scan on purchases_assignments_purchase_components (cost=0.00..2,281.18 rows=507 width=21) (actual time=34.218..40.675 rows=3,682 loops=1)

  • Filter: (idpu = 24363)
191. 0.340 0.340 ↑ 1.0 1 170

Index Only Scan using ll_users_uid_wid_key on ll_users seller (cost=0.42..5.13 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=170)

  • Index Cond: (uid = purchases_assignments_purchase_components.seller)
  • Heap Fetches: 170
192. 0.170 0.170 ↓ 0.0 0 170

Index Only Scan using assignments_whitelabels_pkey on assignments_whitelabels aw (cost=0.27..0.53 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=170)

  • Index Cond: (ida = purchases_assignments_purchase_components.ida)
  • Heap Fetches: 0
193. 0.000 0.000 ↓ 0.0 0

Index Only Scan using roles_purchase_components_accesses_pkey on roles_purchase_components_accesses (cost=0.28..0.46 rows=3 width=6) (never executed)

  • Index Cond: (idrpuc = purchases_assignments_purchase_components.idrpuc)
  • Heap Fetches: 0
194.          

CTE users_accesses

195. 0.424 93.843 ↓ 1.5 541 1

HashAggregate (cost=5,063.68..5,067.30 rows=362 width=6) (actual time=93.669..93.843 rows=541 loops=1)

  • Group Key: ll_users.uid, whitelabels_purchase_accesses.idpua
196. 0.206 93.419 ↓ 1.6 562 1

Append (cost=3.04..5,061.87 rows=362 width=6) (actual time=47.916..93.419 rows=562 loops=1)

197. 0.497 50.036 ↓ 4.3 420 1

Hash Join (cost=3.04..286.97 rows=98 width=6) (actual time=47.915..50.036 rows=420 loops=1)

  • Hash Cond: (ll_users.wid = whitelabels_purchase_accesses.wid)
198. 1.668 1.668 ↓ 1.0 1,588 1

Index Scan using ll_users_admin_idx on ll_users (cost=0.42..277.67 rows=1,519 width=8) (actual time=0.016..1.668 rows=1,588 loops=1)

  • Index Cond: (admin = 'superadmin'::ll_users_admin)
199. 0.022 47.871 ↓ 2.4 60 1

Hash (cost=2.31..2.31 rows=25 width=6) (actual time=47.871..47.871 rows=60 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
200. 0.046 47.849 ↓ 2.4 60 1

Hash Join (cost=1.57..2.31 rows=25 width=6) (actual time=0.053..47.849 rows=60 loops=1)

  • Hash Cond: (whitelabels_purchase_accesses.idpua = purchase_accesses_1.idpua)
201. 47.781 47.781 ↓ 1.9 62 1

CTE Scan on whitelabels_purchase_accesses (cost=0.00..0.64 rows=32 width=6) (actual time=0.020..47.781 rows=62 loops=1)

202. 0.011 0.022 ↓ 1.2 30 1

Hash (cost=1.26..1.26 rows=25 width=2) (actual time=0.022..0.022 rows=30 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
203. 0.011 0.011 ↓ 1.2 30 1

Seq Scan on purchase_accesses purchase_accesses_1 (cost=0.00..1.26 rows=25 width=2) (actual time=0.002..0.011 rows=30 loops=1)

  • Filter: grant_to_superadmins
  • Rows Removed by Filter: 1
204. 2.568 43.177 ↑ 1.9 142 1

Hash Join (cost=2,822.33..4,771.28 rows=264 width=6) (actual time=19.813..43.177 rows=142 loops=1)

  • Hash Cond: (assignments_users.ida = purchases_assignments_purchase_components_1.ida)
  • Join Filter: ((NOT purchases_assignments_purchase_components_1.seller_only) OR (purchases_assignments_purchase_components_1.seller = assignments_users.uid))
  • Rows Removed by Join Filter: 8
205. 4.176 22.044 ↑ 1.1 11,605 1

Append (cost=0.00..1,893.12 rows=13,137 width=8) (actual time=0.013..22.044 rows=11,605 loops=1)

206. 2.194 2.194 ↓ 1.0 7,959 1

Seq Scan on assignments_users (cost=0.00..125.66 rows=7,866 width=8) (actual time=0.012..2.194 rows=7,959 loops=1)

207. 1.387 15.674 ↑ 1.4 3,646 1

Subquery Scan on *SELECT* 2_3 (cost=1,625.56..1,767.46 rows=5,271 width=8) (actual time=9.897..15.674 rows=3,646 loops=1)

208. 2.658 14.287 ↑ 1.4 3,646 1

Merge Join (cost=1,625.56..1,714.75 rows=5,271 width=8) (actual time=9.896..14.287 rows=3,646 loops=1)

  • Merge Cond: (assignments_1.wid = ll_users_1.wid)
209. 0.368 0.649 ↑ 1.0 585 1

Sort (cost=85.62..87.09 rows=586 width=8) (actual time=0.511..0.649 rows=585 loops=1)

  • Sort Key: assignments_1.wid
  • Sort Method: quicksort Memory: 52kB
210. 0.244 0.281 ↑ 1.0 585 1

Bitmap Heap Scan on assignments assignments_1 (cost=20.82..58.68 rows=586 width=8) (actual time=0.048..0.281 rows=585 loops=1)

  • Filter: all_users
  • Heap Blocks: exact=32
211. 0.037 0.037 ↑ 1.0 585 1

Bitmap Index Scan on assignments_all_users_idx (cost=0.00..20.68 rows=586 width=0) (actual time=0.036..0.037 rows=585 loops=1)

  • Index Cond: (all_users = true)
212. 4.207 10.980 ↓ 1.1 7,503 1

Sort (cost=1,539.93..1,556.71 rows=6,712 width=8) (actual time=9.364..10.980 rows=7,503 loops=1)

  • Sort Key: ll_users_1.wid
  • Sort Method: quicksort Memory: 514kB
213. 6.773 6.773 ↓ 1.0 6,855 1

Index Scan using ll_users_admin_idx on ll_users ll_users_1 (cost=0.42..1,113.30 rows=6,712 width=8) (actual time=0.025..6.773 rows=6,855 loops=1)

  • Index Cond: (admin = ANY ('{admin,superadmin}'::ll_users_admin[]))
214. 0.137 18.565 ↓ 50.1 401 1

Hash (cost=2,822.23..2,822.23 rows=8 width=11) (actual time=18.565..18.565 rows=401 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 27kB
215. 0.350 18.428 ↓ 50.1 401 1

Nested Loop (cost=1.68..2,822.23 rows=8 width=11) (actual time=0.482..18.428 rows=401 loops=1)

216. 3.543 17.677 ↓ 50.1 401 1

Nested Loop (cost=1.40..2,819.87 rows=8 width=15) (actual time=0.468..17.677 rows=401 loops=1)

  • Join Filter: (whitelabels_purchase_accesses_1.idpua = roles_purchase_components_accesses_1.idpua)
  • Rows Removed by Join Filter: 10989
217. 2.559 3.470 ↓ 65.8 5,332 1

Hash Join (cost=1.12..2,790.05 rows=81 width=19) (actual time=0.126..3.470 rows=5,332 loops=1)

  • Hash Cond: ((purchases_assignments_purchase_components_1.wid = whitelabels_purchase_accesses_1.wid) AND (purchases_assignments_purchase_components_1.idpu = whitelabels_purchase_accesses_1.idpu))
218. 0.868 0.868 ↑ 27.5 3,682 1

CTE Scan on purchases_assignments_purchase_components purchases_assignments_purchase_components_1 (cost=0.00..2,027.72 rows=101,386 width=25) (actual time=0.001..0.868 rows=3,682 loops=1)

219. 0.022 0.043 ↓ 1.9 62 1

Hash (cost=0.64..0.64 rows=32 width=10) (actual time=0.043..0.043 rows=62 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
220. 0.021 0.021 ↓ 1.9 62 1

CTE Scan on whitelabels_purchase_accesses whitelabels_purchase_accesses_1 (cost=0.00..0.64 rows=32 width=10) (actual time=0.001..0.021 rows=62 loops=1)

221. 10.664 10.664 ↑ 1.5 2 5,332

Index Only Scan using roles_purchase_components_accesses_pkey on roles_purchase_components_accesses roles_purchase_components_accesses_1 (cost=0.28..0.33 rows=3 width=6) (actual time=0.001..0.002 rows=2 loops=5,332)

  • Index Cond: (idrpuc = purchases_assignments_purchase_components_1.idrpuc)
  • Heap Fetches: 11390
222. 0.401 0.401 ↑ 1.0 1 401

Index Only Scan using roles_idr_idx on roles r_1 (cost=0.28..0.30 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=401)

  • Index Cond: (idr = purchases_assignments_purchase_components_1.idr)
  • Heap Fetches: 70
223. 0.261 94.395 ↓ 1.5 541 1

Sort (cost=22.62..23.53 rows=362 width=6) (actual time=94.289..94.395 rows=541 loops=1)

  • Sort Key: users_accesses.uid
  • Sort Method: quicksort Memory: 50kB
224. 94.134 94.134 ↓ 1.5 541 1

CTE Scan on users_accesses (cost=0.00..7.24 rows=362 width=6) (actual time=93.672..94.134 rows=541 loops=1)

Planning time : 23.143 ms