explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Us3a

Settings
# exclusive inclusive rows x rows loops node
1. 1.079 3,238.927 ↓ 704.3 12,677 1

Limit (cost=228,979,374.84..228,979,374.88 rows=18 width=3,625) (actual time=3,235.003..3,238.927 rows=12,677 loops=1)

2.          

CTE schedule_block_report

3. 0.232 99.131 ↑ 1.4 1,446 1

Nested Loop (cost=111,926.39..175,478.77 rows=1,991 width=151) (actual time=34.221..99.131 rows=1,446 loops=1)

4. 0.023 0.023 ↑ 1.0 1 1

Seq Scan on tenant (cost=0.00..2.26 rows=1 width=8) (actual time=0.008..0.023 rows=1 loops=1)

  • Filter: ((NOT retired) AND (tenant_id = 511))
  • Rows Removed by Filter: 7
5. 1.450 98.876 ↑ 1.4 1,446 1

Hash Join (cost=111,926.39..175,416.78 rows=1,991 width=151) (actual time=34.210..98.876 rows=1,446 loops=1)

  • Hash Cond: (schedule_block.schedule_id = schedule.schedule_id)
6. 67.771 79.778 ↑ 1.2 9,388 1

Bitmap Heap Scan on schedule_block (cost=3,636.50..67,024.29 rows=11,430 width=143) (actual time=16.369..79.778 rows=9,388 loops=1)

  • Recheck Cond: (tenant_id = 511)
  • Filter: ((NOT created_by_app) AND ('2019-01-01 00:00:00+00'::timestamp with time zone <= end_dt) AND ('2019-12-31 00:00:00+00'::timestamp with time zone >= start_dt) AND ((block_type)::text = 'DEFAULT'::text))
  • Rows Removed by Filter: 124806
  • Heap Blocks: exact=23695
7. 12.007 12.007 ↑ 1.0 134,194 1

Bitmap Index Scan on idx_fk_schedule_block_tenant_id (cost=0.00..3,633.64 rows=135,095 width=0) (actual time=12.007..12.007 rows=134,194 loops=1)

  • Index Cond: (tenant_id = 511)
8. 0.038 17.648 ↑ 47.4 88 1

Hash (cost=108,154.24..108,154.24 rows=4,174 width=16) (actual time=17.648..17.648 rows=88 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 69kB
9. 0.786 17.610 ↑ 47.4 88 1

Index Scan using idx_schedule_tenant_id on schedule (cost=0.29..108,154.24 rows=4,174 width=16) (actual time=0.491..17.610 rows=88 loops=1)

  • Index Cond: (tenant_id = 511)
  • Filter: (SubPlan 1)
  • Rows Removed by Filter: 8324
10.          

SubPlan (for Index Scan)

11. 8.060 16.824 ↓ 0.0 0 8,412

Nested Loop (cost=3.23..12.81 rows=1 width=0) (actual time=0.002..0.002 rows=0 loops=8,412)

12. 0.000 8.412 ↓ 0.0 0 8,412

Bitmap Heap Scan on mv_service_provider (cost=2.80..7.31 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=8,412)

  • Recheck Cond: (person_party_id = schedule.party_id)
  • Filter: ((tenant_id = 511) AND (service_party_id = 3169422))
  • Rows Removed by Filter: 0
  • Heap Blocks: exact=2046
13. 8.412 8.412 ↓ 0.0 0 8,412

Bitmap Index Scan on mv_service_provider_person (cost=0.00..2.80 rows=2 width=0) (actual time=0.001..0.001 rows=0 loops=8,412)

  • Index Cond: (person_party_id = schedule.party_id)
14. 0.352 0.352 ↑ 1.0 1 88

Index Scan using idx_pp_id_sfstatus on person_party staff_user (cost=0.43..5.47 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=88)

  • Index Cond: ((id = schedule.party_id) AND (starfish_status = 0))
  • Filter: (tenant_id = 511)
15.          

CTE block_dates

16. 2.526 138.788 ↑ 30,409.6 15,998 1

Unique (cost=161,739,728.42..165,388,422.99 rows=486,492,610 width=16) (actual time=134.323..138.788 rows=15,998 loops=1)

17.          

CTE weekly_days

18. 9.170 79.020 ↑ 13,231.0 39,576 1

Nested Loop (cost=125.03..7,850,702.35 rows=523,630,000 width=16) (actual time=66.546..79.020 rows=39,576 loops=1)

19. 0.224 66.958 ↓ 144.6 1,446 1

Unique (cost=124.60..124.65 rows=10 width=8) (actual time=66.512..66.958 rows=1,446 loops=1)

20. 0.590 66.734 ↓ 144.6 1,446 1

Sort (cost=124.60..124.63 rows=10 width=8) (actual time=66.511..66.734 rows=1,446 loops=1)

  • Sort Key: schedule_block_report_2.temporal_expression_id
  • Sort Method: quicksort Memory: 116kB
21. 66.144 66.144 ↓ 144.6 1,446 1

CTE Scan on schedule_block_report schedule_block_report_2 (cost=0.00..124.44 rows=10 width=8) (actual time=0.005..66.144 rows=1,446 loops=1)

  • Filter: (tenant_id = 511)
22. 2.892 2.892 ↑ 1.0 1 1,446

Index Scan using pk_temporal_expression on temporal_expression temporal_expression_2 (cost=0.42..5.46 rows=1 width=24) (actual time=0.002..0.002 rows=1 loops=1,446)

  • Index Cond: (temporal_expression_id = schedule_block_report_2.temporal_expression_id)
23. 8.627 136.262 ↑ 30,409.6 15,998 1

Sort (cost=153,889,026.06..155,105,257.59 rows=486,492,610 width=16) (actual time=134.321..136.262 rows=15,998 loops=1)

  • Sort Key: weekly_days.possible_day, weekly_days.temporal_expression_id
  • Sort Method: quicksort Memory: 1134kB
24. 1.456 127.635 ↑ 30,409.6 15,998 1

Append (cost=2,424.41..57,563,407.12 rows=486,492,610 width=16) (actual time=71.152..127.635 rows=15,998 loops=1)

25. 25.133 118.607 ↑ 8.4 10,981 1

Hash Join (cost=2,424.41..34,454,198.38 rows=92,610 width=16) (actual time=71.151..118.607 rows=10,981 loops=1)

  • Hash Cond: (weekly_days.temporal_expression_id = temporal_expression_3.temporal_expression_id)
  • Join Filter: ((((pow('2'::double precision, date_part('isodow'::text, weekly_days.possible_day)))::integer & temporal_expression_3.weekly_days) <> 0) AND ((((date_part('week'::text, weekly_days.possible_day) - date_part('week'::text, temporal_expression_3.start_date)))::integer % temporal_expression_3.frequency) = 0))
  • Rows Removed by Join Filter: 18293
26. 89.266 89.266 ↑ 13,231.0 39,576 1

CTE Scan on weekly_days (cost=0.00..31,417,800.00 rows=523,630,000 width=16) (actual time=66.547..89.266 rows=39,576 loops=1)

27. 0.079 4.208 ↑ 187.1 199 1

Hash (cost=1,214.44..1,214.44 rows=37,230 width=32) (actual time=4.208..4.208 rows=199 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 526kB
28. 0.358 4.129 ↑ 187.1 199 1

Nested Loop (cost=124.86..1,214.44 rows=37,230 width=32) (actual time=0.686..4.129 rows=199 loops=1)

29. 0.738 0.879 ↓ 7.2 1,446 1

HashAggregate (cost=124.44..130.44 rows=200 width=8) (actual time=0.668..0.879 rows=1,446 loops=1)

  • Group Key: schedule_block_report_3.temporal_expression_id
30. 0.141 0.141 ↑ 1.4 1,446 1

CTE Scan on schedule_block_report schedule_block_report_3 (cost=0.00..119.46 rows=1,991 width=8) (actual time=0.001..0.141 rows=1,446 loops=1)

31. 2.892 2.892 ↓ 0.0 0 1,446

Index Scan using pk_temporal_expression on temporal_expression temporal_expression_3 (cost=0.42..5.39 rows=1 width=24) (actual time=0.002..0.002 rows=0 loops=1,446)

  • Index Cond: (temporal_expression_id = schedule_block_report_3.temporal_expression_id)
  • Filter: ((te_type)::text = 'WEEKLY'::text)
  • Rows Removed by Filter: 1
32. 0.829 7.572 ↑ 96,950.4 5,017 1

Subquery Scan on *SELECT* 2 (cost=124.86..23,106,430.44 rows=486,400,000 width=16) (actual time=0.636..7.572 rows=5,017 loops=1)

33. 2.953 6.743 ↑ 96,950.4 5,017 1

Nested Loop (cost=124.86..7,298,430.44 rows=486,400,000 width=12) (actual time=0.633..6.743 rows=5,017 loops=1)

34. 0.757 0.898 ↓ 7.2 1,446 1

HashAggregate (cost=124.44..130.44 rows=200 width=8) (actual time=0.607..0.898 rows=1,446 loops=1)

  • Group Key: schedule_block_report_4.temporal_expression_id
35. 0.141 0.141 ↑ 1.4 1,446 1

CTE Scan on schedule_block_report schedule_block_report_4 (cost=0.00..119.46 rows=1,991 width=8) (actual time=0.002..0.141 rows=1,446 loops=1)

36. 2.892 2.892 ↑ 1.0 1 1,446

Index Scan using pk_temporal_expression on temporal_expression temporal_expression_4 (cost=0.42..5.39 rows=1 width=29) (actual time=0.002..0.002 rows=1 loops=1,446)

  • Index Cond: (temporal_expression_id = schedule_block_report_4.temporal_expression_id)
  • Filter: ((te_type)::text = 'DAILY'::text)
  • Rows Removed by Filter: 0
37. 57.943 3,237.848 ↓ 704.3 12,677 1

Sort (cost=63,415,473.07..63,415,473.12 rows=18 width=3,625) (actual time=3,235.002..3,237.848 rows=12,677 loops=1)

  • Sort Key: staff_member.cms_user_ext_id, block_dates.block_date, (((((date(block_dates.block_date))::text || ' '::text) || (schedule_block_report.start_time)::text))::timestamp with time zone), (((((date(block_dates.block_date))::text || ' '::text) || (schedule_block_report.end_time)::text))::timestamp with time zone)
  • Sort Method: external merge Disk: 3752kB
38. 5.811 3,179.905 ↓ 704.3 12,677 1

Unique (cost=63,415,471.66..63,415,472.70 rows=18 width=3,625) (actual time=3,170.848..3,179.905 rows=12,677 loops=1)

39. 38.913 3,174.094 ↓ 704.3 12,677 1

Sort (cost=63,415,471.66..63,415,471.71 rows=18 width=3,625) (actual time=3,170.847..3,174.094 rows=12,677 loops=1)

  • Sort Key: (CASE WHEN (schedule_block_report.retired_date IS NOT NULL) THEN (schedule_block_report.retired_date IS NOT NULL) ELSE (excluded_ranges.start_date IS NOT NULL) END), block_dates.block_date, (date(schedule_block_report.end_date)), (((((date(block_dates.block_date))::text || ' '::text) || (schedule_block_report.start_time)::text))::timestamp with time zone), (((((date(block_dates.block_date))::text || ' '::text) || (schedule_block_report.end_time)::text))::timestamp with time zone), schedule_block_report.block_type, staff_member.first_name, staff_member.last_name, staff_member.username, staff_member.email, staff_member.cms_user_ext_id, ((SubPlan 10)), schedule_block_report.title, schedule_block_report.type_of_meetings, schedule_block_report.created_date, schedule_block_report.updated_date, schedule_block_report.group_session_capacity, ((SubPlan 11)), (COALESCE((SubPlan 12), staff_member.cms_user_ext_id)), (COALESCE((SubPlan 13), staff_member.cms_user_ext_id)), ((SubPlan 14)), ((date_part('epoch'::text, ((((((temporal_expression.end_hour)::text || ':'::text) || (temporal_expression.end_minute)::text) || ':00'::text))::time without time zone - (((((temporal_expression.start_hour)::text || ':'::text) || (temporal_expression.start_minute)::text) || ':00'::text))::time without time zone)) / '60'::double precision))
  • Sort Method: external sort Disk: 3760kB
40. 1.397 3,135.181 ↓ 704.3 12,677 1

Append (cost=1.15..63,415,471.29 rows=18 width=3,625) (actual time=468.641..3,135.181 rows=12,677 loops=1)

41. 526.423 1,921.776 ↓ 31.0 31 1

Nested Loop (cost=1.15..31,713,565.28 rows=1 width=1,621) (actual time=468.640..1,921.776 rows=31 loops=1)

  • Join Filter: ((temporal_expression.temporal_expression_id = block_dates.temporal_expression_id) AND (date(excluded_ranges.start_date) = block_dates.block_date))
  • Rows Removed by Join Filter: 6617363
42. 0.660 70.425 ↓ 522.0 522 1

Nested Loop (cost=1.15..191.18 rows=1 width=560) (actual time=37.107..70.425 rows=522 loops=1)

43. 0.346 68.199 ↓ 522.0 522 1

Nested Loop (cost=0.72..185.69 rows=1 width=486) (actual time=37.098..68.199 rows=522 loops=1)

44. 1.004 38.933 ↓ 144.6 1,446 1

Nested Loop (cost=0.42..179.36 rows=10 width=470) (actual time=34.240..38.933 rows=1,446 loops=1)

45. 35.037 35.037 ↓ 144.6 1,446 1

CTE Scan on schedule_block_report (cost=0.00..124.44 rows=10 width=446) (actual time=34.231..35.037 rows=1,446 loops=1)

  • Filter: (tenant_id = 511)
46. 2.892 2.892 ↑ 1.0 1 1,446

Index Scan using pk_temporal_expression on temporal_expression (cost=0.42..5.46 rows=1 width=24) (actual time=0.002..0.002 rows=1 loops=1,446)

  • Index Cond: (temporal_expression_id = schedule_block_report.temporal_expression_id)
47. 28.920 28.920 ↓ 0.0 0 1,446

Index Scan using idx_fk_temp_expression on excluded_ranges (cost=0.29..0.48 rows=5 width=16) (actual time=0.020..0.020 rows=0 loops=1,446)

  • Index Cond: (temporal_expression_id = temporal_expression.temporal_expression_id)
48. 1.566 1.566 ↑ 1.0 1 522

Index Scan using idx_pp_id_sfstatus on person_party staff_member (cost=0.43..5.47 rows=1 width=90) (actual time=0.003..0.003 rows=1 loops=522)

  • Index Cond: (id = schedule_block_report.staff_member_id)
49. 1,321.704 1,321.704 ↑ 191.9 12,677 522

CTE Scan on block_dates (cost=0.00..31,622,019.65 rows=2,432,463 width=16) (actual time=0.286..2.532 rows=12,677 loops=522)

  • Filter: ((block_date >= '2019-01-01 00:00:00+00'::timestamp with time zone) AND (block_date < '2019-12-31 00:00:00+00'::timestamp with time zone))
  • Rows Removed by Filter: 3321
50.          

SubPlan (for Nested Loop)

51. 0.093 0.310 ↑ 1.0 1 31

Aggregate (cost=18.00..18.03 rows=1 width=32) (actual time=0.009..0.010 rows=1 loops=31)

52. 0.042 0.217 ↑ 2.0 1 31

Nested Loop (cost=0.71..17.99 rows=2 width=10) (actual time=0.007..0.007 rows=1 loops=31)

53. 0.124 0.124 ↑ 2.0 1 31

Index Scan using janice_events on schedule_block_locations schedule_block_locations_1 (cost=0.42..7.29 rows=2 width=8) (actual time=0.004..0.004 rows=1 loops=31)

  • Index Cond: (schedule_event_id = schedule_block_report.schedule_block_id)
54. 0.051 0.051 ↑ 1.0 1 17

Index Scan using pk_location on location location_1 (cost=0.29..5.32 rows=1 width=18) (actual time=0.003..0.003 rows=1 loops=17)

  • Index Cond: (location_id = schedule_block_locations_1.location_id)
55. 0.124 2.387 ↑ 1.0 1 31

Aggregate (cost=97.16..97.19 rows=1 width=32) (actual time=0.077..0.077 rows=1 loops=31)

56. 0.031 2.263 ↓ 0.0 0 31

Result (cost=91.97..97.14 rows=1 width=34) (actual time=0.073..0.073 rows=0 loops=31)

  • One-Time Filter: ((schedule_block_report.block_type)::text = 'DEFAULT'::text)
57. 0.000 2.232 ↓ 0.0 0 31

Nested Loop (cost=91.97..97.14 rows=1 width=34) (actual time=0.072..0.072 rows=0 loops=31)

58. 0.000 2.232 ↓ 0.0 0 31

Nested Loop (cost=91.55..96.63 rows=1 width=8) (actual time=0.072..0.072 rows=0 loops=31)

59. 0.062 2.232 ↓ 0.0 0 31

Unique (cost=91.12..91.13 rows=1 width=8) (actual time=0.072..0.072 rows=0 loops=31)

60. 0.124 2.170 ↓ 0.0 0 31

Sort (cost=91.12..91.13 rows=1 width=8) (actual time=0.070..0.070 rows=0 loops=31)

  • Sort Key: appointment_1.section_id
  • Sort Method: quicksort Memory: 25kB
61. 2.046 2.046 ↓ 0.0 0 31

Index Scan using idx_fk_appointment_schedule_block on appointment appointment_1 (cost=0.43..91.11 rows=1 width=8) (actual time=0.066..0.066 rows=0 loops=31)

  • Index Cond: (block_schedule_id = schedule_block_report.schedule_block_id)
  • Filter: ((cancel_dt IS NULL) AND (tenant_id = 511) AND (block_dates.block_date = date(start_dt)))
  • Rows Removed by Filter: 58
62. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_section on section section_1 (cost=0.43..5.47 rows=1 width=16) (never executed)

  • Index Cond: (section_id = appointment_1.section_id)
  • Filter: (tenant_id = 511)
63. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_course on course course_1 (cost=0.42..0.48 rows=1 width=42) (never executed)

  • Index Cond: (id = section_1.course_id)
64. 0.093 0.093 ↑ 1.0 1 31

Index Scan using idx_pp_id_sfstatus on person_party created_by_staff_member_1 (cost=0.43..5.47 rows=1 width=14) (actual time=0.002..0.003 rows=1 loops=31)

  • Index Cond: (id = schedule_block_report.created_by)
65. 0.062 0.062 ↑ 1.0 1 31

Index Scan using idx_pp_id_sfstatus on person_party updated_by_staff_member_1 (cost=0.43..5.47 rows=1 width=14) (actual time=0.002..0.002 rows=1 loops=31)

  • Index Cond: (id = schedule_block_report.updated_by)
66. 0.062 0.372 ↑ 1.0 1 31

Aggregate (cost=10.81..10.84 rows=1 width=32) (actual time=0.012..0.012 rows=1 loops=31)

67. 0.100 0.310 ↑ 1.0 1 31

Nested Loop (cost=0.70..10.80 rows=1 width=28) (actual time=0.008..0.010 rows=1 loops=31)

68. 0.124 0.124 ↑ 1.0 1 31

Index Only Scan using pk_schedule_block_appointment_types on schedule_block_appointment_types schedule_block_appointment_types_1 (cost=0.42..5.46 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=31)

  • Index Cond: (schedule_event_id = schedule_block_report.schedule_block_id)
  • Heap Fetches: 43
69. 0.086 0.086 ↑ 1.0 1 43

Index Scan using pk_appointment_type_id on appointment_type appointment_type_1 (cost=0.28..5.31 rows=1 width=36) (actual time=0.002..0.002 rows=1 loops=43)

  • Index Cond: (appointment_type_id = schedule_block_appointment_types_1.appointment_type_id)
70. 67.666 1,212.008 ↓ 743.9 12,646 1

Nested Loop (cost=125.91..31,701,905.47 rows=17 width=1,621) (actual time=1.023..1,212.008 rows=12,646 loops=1)

71. 15.669 94.724 ↓ 743.9 12,646 1

Nested Loop Anti Join (cost=125.48..31,699,481.64 rows=17 width=462) (actual time=0.894..94.724 rows=12,646 loops=1)

  • Join Filter: (block_dates_1.block_date = date(excluded_ranges_1.start_date))
  • Rows Removed by Join Filter: 33808
72. 2.357 53.701 ↓ 551.2 12,677 1

Nested Loop (cost=125.19..31,699,339.22 rows=23 width=470) (actual time=0.888..53.701 rows=12,677 loops=1)

  • Join Filter: (schedule_block_report_1.temporal_expression_id = temporal_expression_1.temporal_expression_id)
73. 8.152 13.313 ↑ 9.6 12,677 1

Hash Join (cost=124.76..31,634,914.84 rows=121,623 width=462) (actual time=0.876..13.313 rows=12,677 loops=1)

  • Hash Cond: (block_dates_1.temporal_expression_id = schedule_block_report_1.temporal_expression_id)
74. 4.337 4.337 ↑ 191.9 12,677 1

CTE Scan on block_dates block_dates_1 (cost=0.00..31,622,019.65 rows=2,432,463 width=16) (actual time=0.038..4.337 rows=12,677 loops=1)

  • Filter: ((block_date >= '2019-01-01 00:00:00+00'::timestamp with time zone) AND (block_date < '2019-12-31 00:00:00+00'::timestamp with time zone))
  • Rows Removed by Filter: 3321
75. 0.359 0.824 ↓ 144.6 1,446 1

Hash (cost=124.44..124.44 rows=10 width=446) (actual time=0.824..0.824 rows=1,446 loops=1)

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 252kB
76. 0.465 0.465 ↓ 144.6 1,446 1

CTE Scan on schedule_block_report schedule_block_report_1 (cost=0.00..124.44 rows=10 width=446) (actual time=0.003..0.465 rows=1,446 loops=1)

  • Filter: (tenant_id = 511)
77. 38.031 38.031 ↑ 1.0 1 12,677

Index Scan using pk_temporal_expression on temporal_expression temporal_expression_1 (cost=0.42..0.50 rows=1 width=24) (actual time=0.003..0.003 rows=1 loops=12,677)

  • Index Cond: (temporal_expression_id = block_dates_1.temporal_expression_id)
78. 25.354 25.354 ↑ 1.7 3 12,677

Index Scan using idx_fk_temp_expression on excluded_ranges excluded_ranges_1 (cost=0.29..6.02 rows=5 width=16) (actual time=0.002..0.002 rows=3 loops=12,677)

  • Index Cond: (temporal_expression_id = schedule_block_report_1.temporal_expression_id)
79. 25.292 25.292 ↑ 1.0 1 12,646

Index Scan using idx_pp_id_sfstatus on person_party staff_member_1 (cost=0.43..5.47 rows=1 width=90) (actual time=0.002..0.002 rows=1 loops=12,646)

  • Index Cond: (id = schedule_block_report_1.staff_member_id)
80.          

SubPlan (for Nested Loop)

81. 12.646 214.982 ↑ 1.0 1 12,646

Aggregate (cost=18.00..18.03 rows=1 width=32) (actual time=0.017..0.017 rows=1 loops=12,646)

82. 0.106 202.336 ↑ 2.0 1 12,646

Nested Loop (cost=0.71..17.99 rows=2 width=10) (actual time=0.015..0.016 rows=1 loops=12,646)

83. 177.044 177.044 ↑ 2.0 1 12,646

Index Scan using janice_events on schedule_block_locations (cost=0.42..7.29 rows=2 width=8) (actual time=0.013..0.014 rows=1 loops=12,646)

  • Index Cond: (schedule_event_id = schedule_block_report_1.schedule_block_id)
84. 25.186 25.186 ↑ 1.0 1 12,593

Index Scan using pk_location on location (cost=0.29..5.32 rows=1 width=18) (actual time=0.002..0.002 rows=1 loops=12,593)

  • Index Cond: (location_id = schedule_block_locations.location_id)
85. 12.646 581.716 ↑ 1.0 1 12,646

Aggregate (cost=97.16..97.19 rows=1 width=32) (actual time=0.046..0.046 rows=1 loops=12,646)

86. 12.646 569.070 ↓ 0.0 0 12,646

Result (cost=91.97..97.14 rows=1 width=34) (actual time=0.045..0.045 rows=0 loops=12,646)

  • One-Time Filter: ((schedule_block_report_1.block_type)::text = 'DEFAULT'::text)
87. 0.000 556.424 ↓ 0.0 0 12,646

Nested Loop (cost=91.97..97.14 rows=1 width=34) (actual time=0.044..0.044 rows=0 loops=12,646)

88. 0.000 556.424 ↓ 0.0 0 12,646

Nested Loop (cost=91.55..96.63 rows=1 width=8) (actual time=0.041..0.044 rows=0 loops=12,646)

89. 0.000 493.194 ↓ 0.0 0 12,646

Unique (cost=91.12..91.13 rows=1 width=8) (actual time=0.039..0.039 rows=0 loops=12,646)

90. 12.646 493.194 ↓ 0.0 0 12,646

Sort (cost=91.12..91.13 rows=1 width=8) (actual time=0.039..0.039 rows=0 loops=12,646)

  • Sort Key: appointment.section_id
  • Sort Method: quicksort Memory: 25kB
91. 480.548 480.548 ↓ 0.0 0 12,646

Index Scan using idx_fk_appointment_schedule_block on appointment (cost=0.43..91.11 rows=1 width=8) (actual time=0.037..0.038 rows=0 loops=12,646)

  • Index Cond: (block_schedule_id = schedule_block_report_1.schedule_block_id)
  • Filter: ((cancel_dt IS NULL) AND (tenant_id = 511) AND (block_dates_1.block_date = date(start_dt)))
  • Rows Removed by Filter: 37
92. 64.664 64.664 ↓ 0.0 0 1,096

Index Scan using pk_section on section (cost=0.43..5.47 rows=1 width=16) (actual time=0.059..0.059 rows=0 loops=1,096)

  • Index Cond: (section_id = appointment.section_id)
  • Filter: (tenant_id = 511)
93. 0.000 0.000 ↓ 0.0 0 108

Index Scan using pk_course on course (cost=0.42..0.48 rows=1 width=42) (actual time=0.000..0.000 rows=0 loops=108)

  • Index Cond: (id = section.course_id)
94. 25.292 25.292 ↑ 1.0 1 12,646

Index Scan using idx_pp_id_sfstatus on person_party created_by_staff_member (cost=0.43..5.47 rows=1 width=14) (actual time=0.002..0.002 rows=1 loops=12,646)

  • Index Cond: (id = schedule_block_report_1.created_by)
95. 25.292 25.292 ↑ 1.0 1 12,646

Index Scan using idx_pp_id_sfstatus on person_party updated_by_staff_member (cost=0.43..5.47 rows=1 width=14) (actual time=0.001..0.002 rows=1 loops=12,646)

  • Index Cond: (id = schedule_block_report_1.updated_by)
96. 12.646 177.044 ↑ 1.0 1 12,646

Aggregate (cost=10.81..10.84 rows=1 width=32) (actual time=0.014..0.014 rows=1 loops=12,646)

97. 16.183 164.398 ↓ 2.0 2 12,646

Nested Loop (cost=0.70..10.80 rows=1 width=28) (actual time=0.011..0.013 rows=2 loops=12,646)

98. 126.460 126.460 ↓ 2.0 2 12,646

Index Only Scan using pk_schedule_block_appointment_types on schedule_block_appointment_types (cost=0.42..5.46 rows=1 width=8) (actual time=0.010..0.010 rows=2 loops=12,646)

  • Index Cond: (schedule_event_id = schedule_block_report_1.schedule_block_id)
  • Heap Fetches: 21755
99. 21.755 21.755 ↑ 1.0 1 21,755

Index Scan using pk_appointment_type_id on appointment_type (cost=0.28..5.31 rows=1 width=36) (actual time=0.001..0.001 rows=1 loops=21,755)

  • Index Cond: (appointment_type_id = schedule_block_appointment_types.appointment_type_id)
Planning time : 4.627 ms
Execution time : 3,244.440 ms