explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FAxF

Settings
# exclusive inclusive rows x rows loops node
1. 239.942 22,217.272 ↓ 0.0 0 1

Insert on report_items_t (cost=1,162,704.99..6,944,117.27 rows=22,094 width=164) (actual time=22,217.272..22,217.272 rows=0 loops=1)

2. 6,836.520 21,977.330 ↓ 3.9 85,919 1

Hash Left Join (cost=1,162,704.99..6,944,117.27 rows=22,094 width=164) (actual time=2,473.856..21,977.330 rows=85,919 loops=1)

  • Hash Cond: ((projects.id = ""*SELECT* 1"".project_id) AND ((COALESCE(""*SELECT* 1_1"".activity_id, sa.activity_id)) = ""*SELECT* 1"".activity_id))
  • Join Filter: (("*SELECT* 1_1".date >= "*SELECT* 1".start_date) AND (("*SELECT* 1_1".date <= "*SELECT* 1".end_date) OR ("*SELECT* 1".end_date IS NULL)))
  • Rows Removed by Join Filter: 2766
3. 53.377 14,430.474 ↓ 3.9 85,919 1

Nested Loop (cost=1,137,303.16..5,437,336.71 rows=22,094 width=136) (actual time=1,761.974..14,430.474 rows=85,919 loops=1)

4. 0.021 0.021 ↑ 1.0 1 1

Index Scan using accounts_pkey on accounts (cost=0.15..8.18 rows=1 width=4) (actual time=0.020..0.021 rows=1 loops=1)

  • Index Cond: (id = 144)
  • Filter: ((suspended_at)::date >= ('now'::cstring)::date)
5. 43.245 14,377.076 ↓ 3.9 85,919 1

Append (cost=1,137,303.02..5,436,886.66 rows=22,094 width=148) (actual time=1,761.946..14,377.076 rows=85,919 loops=1)

6. 218.603 14,169.619 ↓ 3.8 82,852 1

Hash Left Join (cost=1,137,303.02..5,421,291.69 rows=21,762 width=149) (actual time=1,761.945..14,169.619 rows=82,852 loops=1)

  • Hash Cond: ((projects.account_id = sa.account_id) AND ("*SELECT* 1_1".user_id = sa.user_id))
  • Join Filter: (("*SELECT* 1_1".date >= sa.start_date) AND ("*SELECT* 1_1".date <= sa.end_date))
  • Rows Removed by Join Filter: 28622
  • Filter: ((((""*SELECT* 1_1"".vacation_user_id)::double precision) IS NULL) OR (((""*SELECT* 1_1"".vacation_hours)::double precision) < (COALESCE(sa.capacity, accounts_1.default_capacity))::double precision))
  • Rows Removed by Filter: 2225
7. 113.127 13,929.931 ↓ 1.3 85,077 1

Hash Join (cost=1,136,356.03..5,418,855.30 rows=64,640 width=125) (actual time=1,738.689..13,929.931 rows=85,077 loops=1)

  • Hash Cond: ("*SELECT* 1_1".project_id = projects.id)
8. 90.971 13,814.989 ↑ 1.0 221,076 1

Append (cost=1,136,156.17..5,414,939.52 rows=223,238 width=83) (actual time=1,735.282..13,814.989 rows=221,076 loops=1)

9. 121.933 11,889.881 ↑ 1.0 150,333 1

Result (cost=1,136,156.17..5,334,837.42 rows=152,080 width=95) (actual time=1,735.282..11,889.881 rows=150,333 loops=1)

10. 60.234 11,767.948 ↑ 1.0 150,333 1

Append (cost=1,136,156.17..5,334,837.42 rows=152,080 width=95) (actual time=1,735.276..11,767.948 rows=150,333 loops=1)

11. 78.045 2,903.637 ↑ 1.1 129,387 1

Subquery Scan on *SELECT* 1_1 (cost=1,136,156.17..3,072,537.70 rows=140,012 width=98) (actual time=1,735.274..2,903.637 rows=129,387 loops=1)

12. 1,063.419 2,825.592 ↑ 1.1 129,387 1

Hash Right Join (cost=1,136,156.17..3,071,137.58 rows=140,012 width=98) (actual time=1,735.270..2,825.592 rows=129,387 loops=1)

  • Hash Cond: ((staff_memberships.account_id = projects_1.account_id) AND (staff_memberships.user_id = plan_rows.user_id))
  • Join Filter: (generate_series.generate_series = ((generate_series_1.generate_series)::date))
  • Rows Removed by Join Filter: 5694614
13. 46.519 132.632 ↑ 18.9 29,858 1

HashAggregate (cost=574,214.55..582,677.55 rows=564,200 width=21) (actual time=105.131..132.632 rows=29,858 loops=1)

  • Group Key: generate_series_1.generate_series, staff_memberships.user_id, staff_memberships.account_id
14. 20.955 86.113 ↑ 143.2 29,988 1

Nested Loop (cost=135.84..531,265.67 rows=4,294,888 width=21) (actual time=2.609..86.113 rows=29,988 loops=1)

  • Join Filter: ((generate_series_1.generate_series >= staff_memberships.joined_at) AND ((staff_memberships.archived_at IS NULL) OR (generate_series_1.generate_series <= staff_memberships.archived_at)))
  • Rows Removed by Join Filter: 1908
15. 14.495 22.730 ↑ 1.0 21,214 1

Hash Join (cost=135.83..915.66 rows=21,214 width=29) (actual time=2.586..22.730 rows=21,214 loops=1)

  • Hash Cond: (vacations.staff_membership_id = staff_memberships.id)
16. 5.681 5.681 ↑ 1.0 21,214 1

Seq Scan on vacations (cost=0.00..488.14 rows=21,214 width=17) (actual time=0.009..5.681 rows=21,214 loops=1)

17. 1.227 2.554 ↑ 1.0 3,948 1

Hash (cost=86.48..86.48 rows=3,948 width=20) (actual time=2.554..2.554 rows=3,948 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 227kB
18. 1.327 1.327 ↑ 1.0 3,948 1

Seq Scan on staff_memberships (cost=0.00..86.48 rows=3,948 width=20) (actual time=0.005..1.327 rows=3,948 loops=1)

19. 42.428 42.428 ↑ 500.0 2 21,214

Function Scan on generate_series generate_series_1 (cost=0.01..10.01 rows=1,000 width=8) (actual time=0.001..0.002 rows=2 loops=21,214)

20. 55.563 1,629.541 ↑ 1.1 129,387 1

Hash (cost=559,841.44..559,841.44 rows=140,012 width=66) (actual time=1,629.541..1,629.541 rows=129,387 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 15284kB
21. 670.158 1,573.978 ↑ 1.1 129,387 1

Hash Anti Join (cost=541,815.84..559,841.44 rows=140,012 width=66) (actual time=668.521..1,573.978 rows=129,387 loops=1)

  • Hash Cond: ((projects_1.account_id = non_working_intervals_by_dates.account_id) AND (plan_rows.user_id = non_working_intervals_by_dates.user_id))
  • Join Filter: (generate_series.generate_series = non_working_intervals_by_dates.date)
  • Rows Removed by Join Filter: 4119344
22. 74.263 867.889 ↑ 1.3 132,762 1

Hash Join (cost=539,688.16..543,397.39 rows=175,864 width=66) (actual time=632.497..867.889 rows=132,762 loops=1)

  • Hash Cond: (project_plans.project_id = projects_1.id)
23. 115.473 790.389 ↑ 1.3 132,762 1

Hash Right Join (cost=539,463.18..540,754.28 rows=175,864 width=62) (actual time=629.244..790.389 rows=132,762 loops=1)

  • Hash Cond: ((plan_rows_1.project_plan_id = project_plans.id) AND (((min(((plan_rows_1.uuid)::character varying)::text))::uuid) = plan_items.plan_row_uuid) AND (plan_rows_1.user_id = plan_rows.user_id))
  • Join Filter: (((plan_rows_1.epic_id = plan_rows.epic_id) OR (plan_rows.epic_id IS NULL)) AND ((generate_series.generate_series)::date >= (COALESCE(plan_roles.start_date, '1980-01-01'::date))) AND ((generate_series.generate_series)::date <= (COALESCE(lag((plan_roles.start_date - 1), 1) OVER (?), '3000-01-01'::date))))
  • Rows Removed by Join Filter: 661
24. 83.007 243.180 ↓ 8.8 43,112 1

HashAggregate (cost=8,747.41..8,820.49 rows=4,872 width=40) (actual time=197.180..243.180 rows=43,112 loops=1)

  • Group Key: plan_rows_1.project_plan_id, plan_rows_1.epic_id, plan_rows_1.user_id, plan_roles.activity_id, COALESCE(plan_roles.start_date, '1980-01-01'::date), COALESCE(lag((plan_roles.start_date - 1), 1) OVER (?), '3000-01-01'::date)
25. 40.674 160.173 ↑ 1.0 43,265 1

WindowAgg (cost=6,367.84..7,341.30 rows=43,265 width=52) (actual time=104.592..160.173 rows=43,265 loops=1)

26. 46.170 119.499 ↑ 1.0 43,265 1

Sort (cost=6,367.84..6,476.00 rows=43,265 width=52) (actual time=104.582..119.499 rows=43,265 loops=1)

  • Sort Key: plan_roles.plan_row_uuid, plan_roles.start_date DESC NULLS LAST
  • Sort Method: quicksort Memory: 4920kB
27. 31.391 73.329 ↑ 1.0 43,265 1

Hash Join (cost=1,581.69..3,036.24 rows=43,265 width=52) (actual time=31.544..73.329 rows=43,265 loops=1)

  • Hash Cond: (plan_roles.plan_row_uuid = plan_rows_1.uuid)
28. 10.485 10.485 ↑ 1.0 43,265 1

Seq Scan on plan_roles (cost=0.00..859.65 rows=43,265 width=24) (actual time=0.005..10.485 rows=43,265 loops=1)

29. 16.106 31.453 ↑ 1.0 46,653 1

Hash (cost=998.53..998.53 rows=46,653 width=28) (actual time=31.453..31.453 rows=46,653 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 3097kB
30. 15.347 15.347 ↑ 1.0 46,653 1

Seq Scan on plan_rows plan_rows_1 (cost=0.00..998.53 rows=46,653 width=28) (actual time=0.005..15.347 rows=46,653 loops=1)

31. 56.514 431.736 ↑ 1.3 132,762 1

Hash (cost=527,638.15..527,638.15 rows=175,864 width=66) (actual time=431.736..431.736 rows=132,762 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 15628kB
32. 75.441 375.222 ↑ 1.3 132,762 1

Nested Loop (cost=1,709.62..527,638.15 rows=175,864 width=66) (actual time=59.180..375.222 rows=132,762 loops=1)

33. 19.535 94.645 ↓ 1.2 25,642 1

Hash Join (cost=1,709.61..3,783.25 rows=21,983 width=66) (actual time=32.110..94.645 rows=25,642 loops=1)

  • Hash Cond: (plan_items.plan_row_uuid = plan_rows.uuid)
34. 24.435 45.416 ↓ 1.1 28,068 1

Hash Join (cost=198.30..1,958.36 rows=25,000 width=54) (actual time=2.332..45.416 rows=28,068 loops=1)

  • Hash Cond: (plan_items.project_plan_id = project_plans.id)
35. 18.667 18.667 ↑ 1.0 52,418 1

Seq Scan on plan_items (cost=0.00..1,313.41 rows=52,440 width=46) (actual time=0.008..18.667 rows=52,418 loops=1)

  • Filter: (utilization > '0'::numeric)
  • Rows Removed by Filter: 255
36. 0.815 2.314 ↓ 1.0 2,818 1

Hash (cost=163.09..163.09 rows=2,817 width=8) (actual time=2.314..2.314 rows=2,818 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 143kB
37. 1.499 1.499 ↓ 1.0 2,818 1

Seq Scan on project_plans (cost=0.00..163.09 rows=2,817 width=8) (actual time=0.004..1.499 rows=2,818 loops=1)

  • Filter: active
  • Rows Removed by Filter: 3091
38. 14.571 29.694 ↓ 1.0 41,065 1

Hash (cost=998.53..998.53 rows=41,022 width=28) (actual time=29.694..29.694 rows=41,065 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 2743kB
39. 15.123 15.123 ↓ 1.0 41,065 1

Seq Scan on plan_rows (cost=0.00..998.53 rows=41,022 width=28) (actual time=0.005..15.123 rows=41,065 loops=1)

  • Filter: (user_id IS NOT NULL)
  • Rows Removed by Filter: 5588
40. 205.136 205.136 ↑ 1.6 5 25,642

Function Scan on generate_series (cost=0.01..23.76 rows=8 width=8) (actual time=0.004..0.008 rows=5 loops=25,642)

  • Filter: (((generate_series)::date >= '2019-06-01'::date) AND (date_part('dow'::text, generate_series) = ANY ('{1,2,3,4,5}'::double precision[])))
  • Rows Removed by Filter: 13
41. 1.556 3.237 ↑ 1.0 5,688 1

Hash (cost=153.88..153.88 rows=5,688 width=8) (actual time=3.237..3.237 rows=5,688 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 287kB
42. 1.681 1.681 ↑ 1.0 5,688 1

Seq Scan on projects projects_1 (cost=0.00..153.88 rows=5,688 width=8) (actual time=0.004..1.681 rows=5,688 loops=1)

43. 17.228 35.931 ↑ 1.0 57,652 1

Hash (cost=1,251.87..1,251.87 rows=58,387 width=12) (actual time=35.931..35.931 rows=57,652 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 2990kB
44. 18.703 18.703 ↑ 1.0 58,387 1

Seq Scan on non_working_intervals_by_dates (cost=0.00..1,251.87 rows=58,387 width=12) (actual time=0.008..18.703 rows=58,387 loops=1)

45. 19.550 8,804.077 ↓ 1.7 20,946 1

Nested Loop (cost=1.15..2,262,179.04 rows=12,068 width=58) (actual time=27.466..8,804.077 rows=20,946 loops=1)

46. 11.492 111.577 ↑ 1.2 2,426 1

Nested Loop (cost=0.86..15,260.84 rows=3,017 width=58) (actual time=0.728..111.577 rows=2,426 loops=1)

47. 17.775 43.949 ↓ 1.1 28,068 1

Nested Loop (cost=0.57..5,963.69 rows=25,000 width=50) (actual time=0.053..43.949 rows=28,068 loops=1)

48. 3.630 3.630 ↓ 1.0 2,818 1

Index Scan using index_project_plans_on_project_id on project_plans project_plans_1 (cost=0.28..337.07 rows=2,817 width=8) (actual time=0.020..3.630 rows=2,818 loops=1)

  • Filter: active
  • Rows Removed by Filter: 3091
49. 22.544 22.544 ↑ 1.9 10 2,818

Index Scan using index_plan_items_on_project_plan_id on plan_items plan_items_1 (cost=0.29..1.81 rows=19 width=46) (actual time=0.002..0.008 rows=10 loops=2,818)

  • Index Cond: (project_plan_id = project_plans_1.id)
  • Filter: (utilization > '0'::numeric)
  • Rows Removed by Filter: 0
50. 56.136 56.136 ↓ 0.0 0 28,068

Index Scan using plan_rows_uuid_key on plan_rows plan_rows_2 (cost=0.29..0.36 rows=1 width=24) (actual time=0.002..0.002 rows=0 loops=28,068)

  • Index Cond: (uuid = plan_items_1.plan_row_uuid)
  • Filter: (user_id IS NULL)
  • Rows Removed by Filter: 1
51. 22.822 8,672.950 ↓ 2.2 9 2,426

Nested Loop (cost=0.29..744.70 rows=4 width=12) (actual time=0.265..3.575 rows=9 loops=2,426)

  • Join Filter: (NOT (SubPlan 1))
  • Rows Removed by Join Filter: 0
52. 4.852 4.852 ↑ 1.0 1 2,426

Index Scan using projects_pkey on projects project (cost=0.28..0.46 rows=1 width=12) (actual time=0.002..0.002 rows=1 loops=2,426)

  • Index Cond: (id = project_plans_1.project_id)
53. 46.094 46.094 ↓ 1.1 9 2,426

Function Scan on generate_series generate_series_2 (cost=0.01..23.76 rows=8 width=8) (actual time=0.009..0.019 rows=9 loops=2,426)

  • Filter: (((generate_series)::date >= '2019-06-01'::date) AND (date_part('dow'::text, generate_series) = ANY ('{1,2,3,4,5}'::double precision[])))
  • Rows Removed by Filter: 25
54.          

SubPlan (for Nested Loop)

55. 42.782 8,599.182 ↓ 0.0 0 21,391

Nested Loop (cost=0.69..90.05 rows=1 width=0) (actual time=0.402..0.402 rows=0 loops=21,391)

  • Join Filter: (non_working_intervals_by_dates_2.office_id = clients_3.office_id)
  • Rows Removed by Join Filter: 1
56. 42.782 42.782 ↑ 1.0 1 21,391

Index Scan using clients_pkey on clients clients_3 (cost=0.28..8.29 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=21,391)

  • Index Cond: (project.client_id = id)
57. 8,513.618 8,513.618 ↑ 11.0 1 21,391

Index Scan using non_working_intervals_by_dates_idx on non_working_intervals_by_dates non_working_intervals_by_dates_2 (cost=0.41..81.62 rows=11 width=4) (actual time=0.394..0.398 rows=1 loops=21,391)

  • Index Cond: ((project.account_id = account_id) AND (generate_series_2.generate_series = date))
58. 1,370.290 1,834.137 ↑ 1.0 70,743 1

Hash Left Join (cost=10,736.05..79,390.52 rows=71,158 width=56) (actual time=307.318..1,834.137 rows=70,743 loops=1)

  • Hash Cond: (time_logs.user_id = pa.user_id)
  • Join Filter: ((time_logs.date >= pa.start_date) AND (time_logs.date <= pa.end_date) AND (((pa.epic_id = time_logs.epic_id) AND (pa.project_plan_id = epics.project_plan_id)) OR ((pa.epic_id IS NULL) AND (pa.project_plan_id = active_plan.id))))
  • Rows Removed by Join Filter: 4710208
59. 60.950 189.722 ↑ 1.0 70,659 1

Hash Left Join (cost=1,805.93..20,348.98 rows=71,158 width=40) (actual time=33.154..189.722 rows=70,659 loops=1)

  • Hash Cond: (time_logs.epic_id = epics.id)
60. 95.686 95.686 ↑ 1.0 70,659 1

Seq Scan on time_logs (cost=0.00..17,564.62 rows=71,158 width=28) (actual time=0.022..95.686 rows=70,659 loops=1)

  • Filter: (date >= '2019-06-01'::date)
  • Rows Removed by Filter: 618111
61. 8.683 33.086 ↑ 1.0 26,132 1

Hash (cost=1,479.28..1,479.28 rows=26,132 width=16) (actual time=33.086..33.086 rows=26,132 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1412kB
62. 15.464 24.403 ↑ 1.0 26,132 1

Hash Left Join (cost=198.30..1,479.28 rows=26,132 width=16) (actual time=2.358..24.403 rows=26,132 loops=1)

  • Hash Cond: (epics.project_id = active_plan.project_id)
63. 6.597 6.597 ↑ 1.0 26,132 1

Seq Scan on epics (cost=0.00..612.32 rows=26,132 width=12) (actual time=0.004..6.597 rows=26,132 loops=1)

64. 0.827 2.342 ↓ 1.0 2,818 1

Hash (cost=163.09..163.09 rows=2,817 width=8) (actual time=2.342..2.342 rows=2,818 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 143kB
65. 1.515 1.515 ↓ 1.0 2,818 1

Seq Scan on project_plans active_plan (cost=0.00..163.09 rows=2,817 width=8) (actual time=0.004..1.515 rows=2,818 loops=1)

  • Filter: active
  • Rows Removed by Filter: 3091
66. 17.245 274.125 ↓ 8.4 41,119 1

Hash (cost=8,869.21..8,869.21 rows=4,872 width=40) (actual time=274.125..274.125 rows=41,119 loops=1)

  • Buckets: 65536 (originally 8192) Batches: 1 (originally 1) Memory Usage: 3290kB
67. 17.979 256.880 ↓ 8.8 43,112 1

Subquery Scan on pa (cost=8,747.41..8,869.21 rows=4,872 width=40) (actual time=194.969..256.880 rows=43,112 loops=1)

68. 80.816 238.901 ↓ 8.8 43,112 1

HashAggregate (cost=8,747.41..8,820.49 rows=4,872 width=40) (actual time=194.967..238.901 rows=43,112 loops=1)

  • Group Key: plan_rows_3.project_plan_id, plan_rows_3.epic_id, plan_rows_3.user_id, plan_roles_1.activity_id, COALESCE(plan_roles_1.start_date, '1980-01-01'::date), COALESCE(lag((plan_roles_1.start_date - 1), 1) OVER (?), '3000-01-01'::date)
69. 40.237 158.085 ↑ 1.0 43,265 1

WindowAgg (cost=6,367.84..7,341.30 rows=43,265 width=52) (actual time=102.052..158.085 rows=43,265 loops=1)

70. 47.126 117.848 ↑ 1.0 43,265 1

Sort (cost=6,367.84..6,476.00 rows=43,265 width=52) (actual time=102.043..117.848 rows=43,265 loops=1)

  • Sort Key: plan_roles_1.plan_row_uuid, plan_roles_1.start_date DESC NULLS LAST
  • Sort Method: quicksort Memory: 4920kB
71. 29.445 70.722 ↑ 1.0 43,265 1

Hash Join (cost=1,581.69..3,036.24 rows=43,265 width=52) (actual time=30.922..70.722 rows=43,265 loops=1)

  • Hash Cond: (plan_roles_1.plan_row_uuid = plan_rows_3.uuid)
72. 10.442 10.442 ↑ 1.0 43,265 1

Seq Scan on plan_roles plan_roles_1 (cost=0.00..859.65 rows=43,265 width=24) (actual time=0.005..10.442 rows=43,265 loops=1)

73. 15.677 30.835 ↑ 1.0 46,653 1

Hash (cost=998.53..998.53 rows=46,653 width=28) (actual time=30.835..30.835 rows=46,653 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 3097kB
74. 15.158 15.158 ↑ 1.0 46,653 1

Seq Scan on plan_rows plan_rows_3 (cost=0.00..998.53 rows=46,653 width=28) (actual time=0.005..15.158 rows=46,653 loops=1)

75. 0.470 1.815 ↑ 1.0 1,646 1

Hash (cost=179.27..179.27 rows=1,647 width=13) (actual time=1.815..1.815 rows=1,646 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 89kB
76. 0.735 1.345 ↑ 1.0 1,646 1

Nested Loop (cost=37.19..179.27 rows=1,647 width=13) (actual time=0.116..1.345 rows=1,646 loops=1)

77. 0.003 0.003 ↑ 1.0 1 1

Index Scan using accounts_pkey on accounts accounts_1 (cost=0.15..8.17 rows=1 width=9) (actual time=0.002..0.003 rows=1 loops=1)

  • Index Cond: (id = 144)
78. 0.504 0.607 ↑ 1.0 1,646 1

Bitmap Heap Scan on projects (cost=37.05..154.63 rows=1,647 width=8) (actual time=0.111..0.607 rows=1,646 loops=1)

  • Recheck Cond: (account_id = 144)
  • Heap Blocks: exact=49
79. 0.103 0.103 ↑ 1.0 1,646 1

Bitmap Index Scan on account_id_on_project_idx (cost=0.00..36.63 rows=1,647 width=0) (actual time=0.103..0.103 rows=1,646 loops=1)

  • Index Cond: (account_id = 144)
80. 0.269 21.085 ↓ 33.8 709 1

Hash (cost=946.67..946.67 rows=21 width=40) (actual time=21.085..21.085 rows=709 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 61kB
81. 1.186 20.816 ↓ 33.8 709 1

Subquery Scan on sa (cost=854.33..946.67 rows=21 width=40) (actual time=18.854..20.816 rows=709 loops=1)

  • Filter: (sa.account_id = 144)
  • Rows Removed by Filter: 3367
82. 2.089 19.630 ↑ 1.0 4,076 1

Unique (cost=854.33..895.37 rows=4,104 width=56) (actual time=16.619..19.630 rows=4,076 loops=1)

83. 3.718 17.541 ↑ 1.0 4,104 1

Sort (cost=854.33..864.59 rows=4,104 width=56) (actual time=16.617..17.541 rows=4,104 loops=1)

  • Sort Key: staff_memberships_1.account_id, staff_memberships_1.user_id, (COALESCE(staff_membership_activity_links.start_date, staff_memberships_1.joined_at)), (COALESCE(lag((staff_membership_activity_links.start_date - 1), 1) OVER (?), staff_memberships_1.archived_at, '3000-01-01'::date)) DESC
  • Sort Method: quicksort Memory: 769kB
84. 4.177 13.823 ↑ 1.0 4,104 1

WindowAgg (cost=515.69..608.03 rows=4,104 width=56) (actual time=8.610..13.823 rows=4,104 loops=1)

85. 3.273 9.646 ↑ 1.0 4,104 1

Sort (cost=515.69..525.95 rows=4,104 width=56) (actual time=8.600..9.646 rows=4,104 loops=1)

  • Sort Key: staff_membership_activity_links.staff_membership_id, staff_membership_activity_links.start_date DESC NULLS LAST
  • Sort Method: quicksort Memory: 770kB
86. 2.708 6.373 ↑ 1.0 4,104 1

Hash Join (cost=135.83..269.40 rows=4,104 width=56) (actual time=2.692..6.373 rows=4,104 loops=1)

  • Hash Cond: (staff_membership_activity_links.staff_membership_id = staff_memberships_1.id)
87. 0.989 0.989 ↑ 1.0 4,111 1

Seq Scan on staff_membership_activity_links (cost=0.00..77.11 rows=4,111 width=28) (actual time=0.005..0.989 rows=4,111 loops=1)

88. 1.295 2.676 ↑ 1.0 3,948 1

Hash (cost=86.48..86.48 rows=3,948 width=32) (actual time=2.676..2.676 rows=3,948 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 273kB
89. 1.381 1.381 ↑ 1.0 3,948 1

Seq Scan on staff_memberships staff_memberships_1 (cost=0.00..86.48 rows=3,948 width=32) (actual time=0.005..1.381 rows=3,948 loops=1)

90. 3.614 164.212 ↓ 9.2 3,067 1

Subquery Scan on *SELECT* 2_1 (cost=2,867.60..15,377.35 rows=332 width=64) (actual time=49.894..164.212 rows=3,067 loops=1)

91. 38.865 160.598 ↓ 9.2 3,067 1

Hash Anti Join (cost=2,867.60..15,374.03 rows=332 width=64) (actual time=49.890..160.598 rows=3,067 loops=1)

  • Hash Cond: ((sa_1.account_id = non_working_intervals_by_dates_1.account_id) AND (sa_1.user_id = non_working_intervals_by_dates_1.user_id))
  • Join Filter: (generate_series_3.generate_series = non_working_intervals_by_dates_1.date)
  • Rows Removed by Join Filter: 162429
92. 7.662 95.919 ↓ 7.0 3,095 1

Nested Loop (cost=946.94..13,409.51 rows=442 width=64) (actual time=23.981..95.919 rows=3,095 loops=1)

  • Join Filter: ((generate_series_3.generate_series >= sa_1.start_date) AND (generate_series_3.generate_series <= sa_1.end_date))
  • Rows Removed by Join Filter: 1402
93. 16.935 43.519 ↓ 45.0 22,369 1

Hash Join (cost=946.93..1,546.11 rows=497 width=72) (actual time=20.858..43.519 rows=22,369 loops=1)

  • Hash Cond: (vacations_1.staff_membership_id = sa_1.staff_membership_id)
94. 5.879 5.879 ↑ 1.0 21,214 1

Seq Scan on vacations vacations_1 (cost=0.00..488.14 rows=21,214 width=44) (actual time=0.004..5.879 rows=21,214 loops=1)

95. 0.280 20.705 ↓ 33.8 709 1

Hash (cost=946.67..946.67 rows=21 width=36) (actual time=20.705..20.705 rows=709 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 57kB
96. 1.153 20.425 ↓ 33.8 709 1

Subquery Scan on sa_1 (cost=854.33..946.67 rows=21 width=36) (actual time=18.473..20.425 rows=709 loops=1)

  • Filter: (sa_1.account_id = 144)
  • Rows Removed by Filter: 3367
97. 2.081 19.272 ↑ 1.0 4,076 1

Unique (cost=854.33..895.37 rows=4,104 width=44) (actual time=16.249..19.272 rows=4,076 loops=1)

98. 3.664 17.191 ↑ 1.0 4,104 1

Sort (cost=854.33..864.59 rows=4,104 width=44) (actual time=16.247..17.191 rows=4,104 loops=1)

  • Sort Key: staff_memberships_2.account_id, staff_memberships_2.user_id, (COALESCE(staff_membership_activity_links_1.start_date, staff_memberships_2.joined_at)), (COALESCE(lag((staff_membership_activity_links_1.start_date - 1), 1) OVER (?), staff_memberships_2.archived_at, '3000-01-01'::date)) DESC
  • Sort Method: quicksort Memory: 574kB
99. 4.000 13.527 ↑ 1.0 4,104 1

WindowAgg (cost=515.69..608.03 rows=4,104 width=44) (actual time=8.509..13.527 rows=4,104 loops=1)

100. 3.179 9.527 ↑ 1.0 4,104 1

Sort (cost=515.69..525.95 rows=4,104 width=44) (actual time=8.502..9.527 rows=4,104 loops=1)

  • Sort Key: staff_membership_activity_links_1.staff_membership_id, staff_membership_activity_links_1.start_date DESC NULLS LAST
  • Sort Method: quicksort Memory: 541kB
101. 2.706 6.348 ↑ 1.0 4,104 1

Hash Join (cost=135.83..269.40 rows=4,104 width=44) (actual time=2.669..6.348 rows=4,104 loops=1)

  • Hash Cond: (staff_membership_activity_links_1.staff_membership_id = staff_memberships_2.id)
102. 0.988 0.988 ↑ 1.0 4,111 1

Seq Scan on staff_membership_activity_links staff_membership_activity_links_1 (cost=0.00..77.11 rows=4,111 width=20) (actual time=0.005..0.988 rows=4,111 loops=1)

103. 1.266 2.654 ↑ 1.0 3,948 1

Hash (cost=86.48..86.48 rows=3,948 width=24) (actual time=2.654..2.654 rows=3,948 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 242kB
104. 1.388 1.388 ↑ 1.0 3,948 1

Seq Scan on staff_memberships staff_memberships_2 (cost=0.00..86.48 rows=3,948 width=24) (actual time=0.004..1.388 rows=3,948 loops=1)

105. 44.738 44.738 ↓ 0.0 0 22,369

Function Scan on generate_series generate_series_3 (cost=0.01..23.76 rows=8 width=8) (actual time=0.002..0.002 rows=0 loops=22,369)

  • Filter: (((generate_series)::date >= '2019-06-01'::date) AND (date_part('dow'::text, generate_series) = ANY ('{1,2,3,4,5}'::double precision[])))
  • Rows Removed by Filter: 1
106. 10.467 25.814 ↑ 1.0 34,676 1

Hash (cost=1,397.84..1,397.84 rows=34,855 width=12) (actual time=25.814..25.814 rows=34,676 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 2002kB
107. 15.347 15.347 ↓ 1.0 34,866 1

Seq Scan on non_working_intervals_by_dates non_working_intervals_by_dates_1 (cost=0.00..1,397.84 rows=34,855 width=12) (actual time=2.228..15.347 rows=34,866 loops=1)

  • Filter: (account_id = 144)
  • Rows Removed by Filter: 23521
108. 110.338 710.336 ↑ 1.0 253,814 1

Hash (cost=21,445.21..21,445.21 rows=263,774 width=44) (actual time=710.336..710.336 rows=253,814 loops=1)

  • Buckets: 524288 Batches: 1 Memory Usage: 23873kB
109. 94.646 599.998 ↑ 1.0 253,814 1

Append (cost=115.88..21,445.21 rows=263,774 width=44) (actual time=1.729..599.998 rows=253,814 loops=1)

110. 0.172 16.827 ↓ 77.6 388 1

Subquery Scan on *SELECT* 1 (cost=115.88..1,546.23 rows=5 width=44) (actual time=1.724..16.827 rows=388 loops=1)

111. 0.240 16.655 ↓ 77.6 388 1

Nested Loop (cost=115.88..1,546.18 rows=5 width=44) (actual time=1.723..16.655 rows=388 loops=1)

112. 1.432 6.591 ↓ 4.0 4 1

Nested Loop (cost=115.46..201.49 rows=1 width=24) (actual time=1.091..6.591 rows=4 loops=1)

113. 0.734 3.741 ↓ 21.8 1,418 1

Nested Loop (cost=115.18..177.24 rows=65 width=24) (actual time=0.992..3.741 rows=1,418 loops=1)

114. 0.127 1.982 ↓ 9.8 205 1

Hash Join (cost=114.89..163.70 rows=21 width=24) (actual time=0.974..1.982 rows=205 loops=1)

  • Hash Cond: (clients.brand_id = brands.id)
115. 0.471 1.789 ↓ 1.1 205 1

Hash Join (cost=111.35..159.25 rows=185 width=32) (actual time=0.899..1.789 rows=205 loops=1)

  • Hash Cond: (clients.brand_id = rate_cards_with_dates.rateable_id)
116. 0.432 0.432 ↑ 1.0 1,822 1

Seq Scan on clients (cost=0.00..39.22 rows=1,822 width=8) (actual time=0.004..0.432 rows=1,822 loops=1)

117. 0.055 0.886 ↑ 1.0 113 1

Hash (cost=109.94..109.94 rows=113 width=24) (actual time=0.886..0.886 rows=113 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
118. 0.046 0.831 ↑ 1.0 113 1

Subquery Scan on rate_cards_with_dates (cost=106.27..109.94 rows=113 width=24) (actual time=0.662..0.831 rows=113 loops=1)

119. 0.102 0.785 ↑ 1.0 113 1

WindowAgg (cost=106.27..108.81 rows=113 width=29) (actual time=0.662..0.785 rows=113 loops=1)

120. 0.076 0.683 ↑ 1.0 113 1

Sort (cost=106.27..106.55 rows=113 width=29) (actual time=0.656..0.683 rows=113 loops=1)

  • Sort Key: rate_cards.rateable_id, rate_cards.start_date DESC NULLS LAST
  • Sort Method: quicksort Memory: 33kB
121. 0.607 0.607 ↑ 1.0 113 1

Seq Scan on rate_cards (cost=0.00..102.41 rows=113 width=29) (actual time=0.145..0.607 rows=113 loops=1)

  • Filter: ((rateable_type)::text = 'Brand'::text)
  • Rows Removed by Filter: 4640
122. 0.015 0.066 ↑ 1.0 113 1

Hash (cost=2.13..2.13 rows=113 width=4) (actual time=0.066..0.066 rows=113 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
123. 0.051 0.051 ↑ 1.0 113 1

Seq Scan on brands (cost=0.00..2.13 rows=113 width=4) (actual time=0.006..0.051 rows=113 loops=1)

124. 1.025 1.025 ↓ 1.8 7 205

Index Scan using index_projects_on_client_id on projects projects_2 (cost=0.28..0.60 rows=4 width=8) (actual time=0.002..0.005 rows=7 loops=205)

  • Index Cond: (client_id = clients.id)
125. 1.418 1.418 ↓ 0.0 0 1,418

Index Scan using index_pricing_models_on_project_id on pricing_models (cost=0.28..0.36 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=1,418)

  • Index Cond: (project_id = projects_2.id)
  • Filter: ((rates_type)::text = 'brand'::text)
  • Rows Removed by Filter: 1
126. 9.824 9.824 ↓ 2.0 97 4

Index Scan using index_rates_on_activity_id_and_rate_card_id on rates (cost=0.42..1,344.21 rows=48 width=28) (actual time=0.580..2.456 rows=97 loops=4)

  • Index Cond: (rate_card_id = rate_cards_with_dates.id)
127. 36.132 158.598 ↓ 2.6 87,639 1

Subquery Scan on *SELECT* 2 (cost=582.68..5,350.63 rows=33,660 width=44) (actual time=22.746..158.598 rows=87,639 loops=1)

128. 75.736 122.466 ↓ 2.6 87,639 1

Hash Join (cost=582.68..5,014.03 rows=33,660 width=44) (actual time=22.745..122.466 rows=87,639 loops=1)

  • Hash Cond: (rates_1.rate_card_id = rate_cards_with_dates_1.id)
129. 38.351 38.351 ↑ 1.0 170,236 1

Seq Scan on rates rates_1 (cost=0.00..3,456.36 rows=170,236 width=28) (actual time=0.004..38.351 rows=170,236 loops=1)

130. 0.211 8.379 ↑ 1.1 632 1

Hash (cost=573.98..573.98 rows=696 width=24) (actual time=8.379..8.379 rows=632 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 46kB
131. 0.330 8.168 ↑ 1.1 632 1

Hash Join (cost=367.19..573.98 rows=696 width=24) (actual time=4.216..8.168 rows=632 loops=1)

  • Hash Cond: (clients_1.office_id = rate_cards_with_dates_1.rateable_id)
132. 0.332 6.060 ↓ 1.0 598 1

Hash Join (cost=222.19..419.78 rows=597 width=12) (actual time=2.431..6.060 rows=598 loops=1)

  • Hash Cond: (clients_1.office_id = offices.id)
133. 0.338 5.495 ↓ 1.0 598 1

Hash Join (cost=208.53..397.92 rows=597 width=8) (actual time=2.191..5.495 rows=598 loops=1)

  • Hash Cond: (projects_3.client_id = clients_1.id)
134. 1.645 4.070 ↓ 1.0 598 1

Hash Join (cost=146.54..327.72 rows=597 width=8) (actual time=1.096..4.070 rows=598 loops=1)

  • Hash Cond: (projects_3.id = pricing_models_1.project_id)
135. 1.340 1.340 ↑ 1.0 5,688 1

Seq Scan on projects projects_3 (cost=0.00..153.88 rows=5,688 width=8) (actual time=0.003..1.340 rows=5,688 loops=1)

136. 0.154 1.085 ↓ 1.0 598 1

Hash (cost=139.07..139.07 rows=597 width=4) (actual time=1.085..1.085 rows=598 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 30kB
137. 0.931 0.931 ↓ 1.0 598 1

Seq Scan on pricing_models pricing_models_1 (cost=0.00..139.07 rows=597 width=4) (actual time=0.014..0.931 rows=598 loops=1)

  • Filter: ((rates_type)::text = 'office'::text)
  • Rows Removed by Filter: 5088
138. 0.508 1.087 ↑ 1.0 1,822 1

Hash (cost=39.22..39.22 rows=1,822 width=8) (actual time=1.087..1.087 rows=1,822 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 88kB
139. 0.579 0.579 ↑ 1.0 1,822 1

Seq Scan on clients clients_1 (cost=0.00..39.22 rows=1,822 width=8) (actual time=0.003..0.579 rows=1,822 loops=1)

140. 0.093 0.233 ↑ 1.0 429 1

Hash (cost=8.29..8.29 rows=429 width=4) (actual time=0.233..0.233 rows=429 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 24kB
141. 0.140 0.140 ↑ 1.0 429 1

Seq Scan on offices (cost=0.00..8.29 rows=429 width=4) (actual time=0.005..0.140 rows=429 loops=1)

142. 0.170 1.778 ↓ 1.0 477 1

Hash (cost=139.05..139.05 rows=476 width=24) (actual time=1.778..1.778 rows=477 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 35kB
143. 0.192 1.608 ↓ 1.0 477 1

Subquery Scan on rate_cards_with_dates_1 (cost=123.58..139.05 rows=476 width=24) (actual time=0.901..1.608 rows=477 loops=1)

144. 0.416 1.416 ↓ 1.0 477 1

WindowAgg (cost=123.58..134.29 rows=476 width=29) (actual time=0.899..1.416 rows=477 loops=1)

145. 0.319 1.000 ↓ 1.0 477 1

Sort (cost=123.58..124.77 rows=476 width=29) (actual time=0.896..1.000 rows=477 loops=1)

  • Sort Key: rate_cards_1.rateable_id, rate_cards_1.start_date DESC NULLS LAST
  • Sort Method: quicksort Memory: 62kB
146. 0.681 0.681 ↓ 1.0 477 1

Seq Scan on rate_cards rate_cards_1 (cost=0.00..102.41 rows=476 width=29) (actual time=0.123..0.681 rows=477 loops=1)

  • Filter: ((rateable_type)::text = 'Office'::text)
  • Rows Removed by Filter: 4276
147. 37.961 172.749 ↑ 2.2 91,492 1

Subquery Scan on *SELECT* 3 (cost=860.43..9,151.11 rows=199,157 width=44) (actual time=16.789..172.749 rows=91,492 loops=1)

148. 79.001 134.788 ↑ 2.2 91,492 1

Hash Join (cost=860.43..7,159.54 rows=199,157 width=44) (actual time=16.787..134.788 rows=91,492 loops=1)

  • Hash Cond: (rates_2.rate_card_id = rate_cards_2.id)
149. 39.049 39.049 ↑ 1.0 170,236 1

Seq Scan on rates rates_2 (cost=0.00..3,456.36 rows=170,236 width=28) (actual time=0.003..39.049 rows=170,236 loops=1)

150. 1.344 16.738 ↑ 1.1 3,915 1

Hash (cost=808.96..808.96 rows=4,118 width=24) (actual time=16.738..16.738 rows=3,915 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 294kB
151. 2.101 15.394 ↑ 1.1 3,915 1

Hash Join (cost=550.07..808.96 rows=4,118 width=24) (actual time=9.059..15.394 rows=3,915 loops=1)

  • Hash Cond: (projects_4.client_id = clients_2.id)
152. 2.810 6.942 ↓ 1.0 3,549 1

Hash Join (cost=183.42..394.11 rows=3,547 width=8) (actual time=2.700..6.942 rows=3,549 loops=1)

  • Hash Cond: (projects_4.id = pricing_models_2.project_id)
153. 1.446 1.446 ↑ 1.0 5,688 1

Seq Scan on projects projects_4 (cost=0.00..153.88 rows=5,688 width=8) (actual time=0.004..1.446 rows=5,688 loops=1)

154. 0.990 2.686 ↓ 1.0 3,549 1

Hash (cost=139.07..139.07 rows=3,548 width=4) (actual time=2.686..2.686 rows=3,549 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 157kB
155. 1.696 1.696 ↓ 1.0 3,550 1

Seq Scan on pricing_models pricing_models_2 (cost=0.00..139.07 rows=3,548 width=4) (actual time=0.009..1.696 rows=3,550 loops=1)

  • Filter: ((rates_type)::text = 'client'::text)
  • Rows Removed by Filter: 2136
156. 0.519 6.351 ↑ 1.0 1,792 1

Hash (cost=344.23..344.23 rows=1,793 width=28) (actual time=6.351..6.351 rows=1,792 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 121kB
157. 1.011 5.832 ↑ 1.0 1,792 1

Hash Join (cost=261.30..344.23 rows=1,793 width=28) (actual time=2.764..5.832 rows=1,792 loops=1)

  • Hash Cond: (rate_cards_2.rateable_id = clients_2.id)
158. 1.642 3.850 ↑ 1.0 1,793 1

WindowAgg (cost=199.31..239.65 rows=1,793 width=29) (actual time=1.785..3.850 rows=1,793 loops=1)

159. 1.193 2.208 ↑ 1.0 1,793 1

Sort (cost=199.31..203.79 rows=1,793 width=29) (actual time=1.780..2.208 rows=1,793 loops=1)

  • Sort Key: rate_cards_2.rateable_id, rate_cards_2.start_date DESC NULLS LAST
  • Sort Method: quicksort Memory: 189kB
160. 1.015 1.015 ↑ 1.0 1,793 1

Seq Scan on rate_cards rate_cards_2 (cost=0.00..102.41 rows=1,793 width=29) (actual time=0.006..1.015 rows=1,793 loops=1)

  • Filter: ((rateable_type)::text = 'Client'::text)
  • Rows Removed by Filter: 2960
161. 0.452 0.971 ↑ 1.0 1,822 1

Hash (cost=39.22..39.22 rows=1,822 width=4) (actual time=0.971..0.971 rows=1,822 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 81kB
162. 0.519 0.519 ↑ 1.0 1,822 1

Seq Scan on clients clients_2 (cost=0.00..39.22 rows=1,822 width=4) (actual time=0.004..0.519 rows=1,822 loops=1)

163. 30.541 157.178 ↓ 2.4 74,295 1

Subquery Scan on *SELECT* 4 (cost=683.46..5,397.24 rows=30,952 width=44) (actual time=11.906..157.178 rows=74,295 loops=1)

164. 74.773 126.637 ↓ 2.4 74,295 1

Hash Join (cost=683.46..5,087.72 rows=30,952 width=44) (actual time=11.905..126.637 rows=74,295 loops=1)

  • Hash Cond: (rates_3.rate_card_id = rate_cards_3.id)
165. 39.979 39.979 ↑ 1.0 170,236 1

Seq Scan on rates rates_3 (cost=0.00..3,456.36 rows=170,236 width=28) (actual time=0.003..39.979 rows=170,236 loops=1)

166. 0.524 11.885 ↓ 2.4 1,563 1

Hash (cost=675.46..675.46 rows=640 width=24) (actual time=11.885..11.885 rows=1,563 loops=1)

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 108kB
167. 1.953 11.361 ↓ 2.4 1,563 1

Hash Join (cost=493.85..675.46 rows=640 width=24) (actual time=8.039..11.361 rows=1,563 loops=1)

  • Hash Cond: (projects_5.id = pricing_models_3.project_id)
168. 1.382 1.382 ↑ 1.0 5,688 1

Seq Scan on projects projects_5 (cost=0.00..153.88 rows=5,688 width=4) (actual time=0.004..1.382 rows=5,688 loops=1)

169. 0.517 8.026 ↓ 2.4 1,563 1

Hash (cost=485.85..485.85 rows=640 width=24) (actual time=8.026..8.026 rows=1,563 loops=1)

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 108kB
170. 1.045 7.509 ↓ 2.4 1,563 1

Hash Join (cost=393.53..485.85 rows=640 width=24) (actual time=3.823..7.509 rows=1,563 loops=1)

  • Hash Cond: (rate_cards_3.rateable_id = pricing_models_3.id)
171. 2.090 4.837 ↑ 1.0 2,370 1

WindowAgg (cost=235.26..288.58 rows=2,370 width=29) (actual time=2.186..4.837 rows=2,370 loops=1)

172. 1.579 2.747 ↑ 1.0 2,370 1

Sort (cost=235.26..241.18 rows=2,370 width=29) (actual time=2.180..2.747 rows=2,370 loops=1)

  • Sort Key: rate_cards_3.rateable_id, rate_cards_3.start_date DESC NULLS LAST
  • Sort Method: quicksort Memory: 282kB
173. 1.168 1.168 ↑ 1.0 2,370 1

Seq Scan on rate_cards rate_cards_3 (cost=0.00..102.41 rows=2,370 width=29) (actual time=0.007..1.168 rows=2,370 loops=1)

  • Filter: ((rateable_type)::text = 'PricingModel'::text)
  • Rows Removed by Filter: 2383
174. 0.430 1.627 ↑ 1.0 1,534 1

Hash (cost=139.07..139.07 rows=1,536 width=8) (actual time=1.627..1.627 rows=1,534 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 76kB
175. 1.197 1.197 ↑ 1.0 1,534 1

Seq Scan on pricing_models pricing_models_3 (cost=0.00..139.07 rows=1,536 width=8) (actual time=0.011..1.197 rows=1,534 loops=1)

  • Filter: ((rates_type)::text = 'custom'::text)
  • Rows Removed by Filter: 4152
Planning time : 7.421 ms
Execution time : 22,219.838 ms