explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4LxmF

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 27,713.513 27,713.513 ↓ 2,261.0 2,261 1

CTE Scan on prior_schedule (cost=1,927,725.14..1,927,725.16 rows=1 width=664) (actual time=26,944.775..27,713.513 rows=2,261 loops=1)

2.          

CTE timeblocks

3. 37.582 4,507.086 ↓ 4,986.0 4,986 1

Nested Loop (cost=1,016.52..1,109.08 rows=1 width=154) (actual time=68.855..4,507.086 rows=4,986 loops=1)

  • Join Filter: (tb.location_id = ul.location_id)
  • Rows Removed by Join Filter: 295
4. 8.923 4,448.808 ↓ 5,174.0 5,174 1

Nested Loop (cost=1,016.09..1,085.46 rows=1 width=177) (actual time=68.275..4,448.808 rows=5,174 loops=1)

5. 4.217 4,424.363 ↓ 5,174.0 5,174 1

Nested Loop (cost=1,015.67..1,083.02 rows=1 width=154) (actual time=68.241..4,424.363 rows=5,174 loops=1)

6. 2.412 4,404.624 ↓ 5,174.0 5,174 1

Nested Loop (cost=1,015.24..1,080.58 rows=1 width=162) (actual time=68.207..4,404.624 rows=5,174 loops=1)

7. 6.538 4,386.690 ↓ 5,174.0 5,174 1

Nested Loop (cost=1,014.95..1,078.28 rows=1 width=170) (actual time=68.184..4,386.690 rows=5,174 loops=1)

8. 262.078 4,364.630 ↓ 5,174.0 5,174 1

Nested Loop (cost=1,014.67..1,076.01 rows=1 width=186) (actual time=68.052..4,364.630 rows=5,174 loops=1)

  • Join Filter: (tb.location_id = de_lo.location_id)
  • Rows Removed by Join Filter: 3266714
9. 7.715 258.270 ↓ 5,174.0 5,174 1

Nested Loop (cost=1,014.25..1,037.45 rows=1 width=170) (actual time=68.008..258.270 rows=5,174 loops=1)

  • Join Filter: (tb.location_id = lo.id)
10. 4.850 240.207 ↓ 5,174.0 5,174 1

Nested Loop (cost=1,013.96..1,035.15 rows=1 width=149) (actual time=67.982..240.207 rows=5,174 loops=1)

11. 8.349 219.835 ↓ 5,174.0 5,174 1

Nested Loop (cost=1,013.54..1,032.70 rows=1 width=133) (actual time=67.946..219.835 rows=5,174 loops=1)

12. 6.823 195.964 ↓ 5,174.0 5,174 1

Nested Loop (cost=1,013.11..1,030.25 rows=1 width=122) (actual time=67.905..195.964 rows=5,174 loops=1)

13. 120.701 168.445 ↓ 5,174.0 5,174 1

Bitmap Heap Scan on timeblock tb (cost=1,012.68..1,027.80 rows=1 width=114) (actual time=67.836..168.445 rows=5,174 loops=1)

  • Recheck Cond: ((location_id = ANY ('{114106}'::bigint[])) AND (employee_id = ANY ('{91672447,24137827,94214053,14294648,95083521,19048609,92146306,88003096,94514269,87697352,17971146,92500768,92801207,87906652,92170354,94185669,19043187,20739895,19043387,94224220,93795134,19043185,17971287,92097293,92254685,93417831,94987951,44372285,19041151,85628241,47686780,86173098,91849701,92848760,92426540,91401606,92146308,95084837,94289481,88468242,19041160,50540711,20739810,47686729,89828632,94224219,19041161,94460520,19041136,19041153,19042027,72165658,88123553,19041138,19041146,93185582,49231582,19041148,94213967,19041169,93994593,63331863,95074069,85832697,86248146,87105440,90921896,19041150,19041145,91556927,91024699,94991158,92588221,19045651,21175130,95087352,19041195,19041894,93698765,19041816,95089691,88123552,95019242,92146307,87553971,95083436,90683166,19045627,95074677,19177944,19041193,94877063,93240899,47686730,88498584,93163779,19460265,95084836,19829476,19045632,95034204,94948427,19041173,93071175,95083987,94264083,95083520,92027616,32068517,94811810,88391754,93163748,93846824,94761944,88106509,94214052,93473045}'::bigint[])))
  • Filter: ((start_date >= '2019-12-01'::date) AND (start_date <= '2020-03-01'::date))
  • Rows Removed by Filter: 48348
  • Heap Blocks: exact=24919
14. 5.831 47.744 ↓ 0.0 0 1

BitmapAnd (cost=1,012.68..1,012.68 rows=13 width=0) (actual time=47.744..47.744 rows=0 loops=1)

15. 28.251 28.251 ↓ 7.4 148,268 1

Bitmap Index Scan on i_timeblock_loc (cost=0.00..205.72 rows=20,020 width=0) (actual time=28.251..28.251 rows=148,268 loops=1)

  • Index Cond: (location_id = ANY ('{114106}'::bigint[]))
16. 13.662 13.662 ↓ 1.1 72,910 1

Bitmap Index Scan on i_timeblock_emp (cost=0.00..806.72 rows=67,551 width=0) (actual time=13.662..13.662 rows=72,910 loops=1)

  • Index Cond: (employee_id = ANY ('{91672447,24137827,94214053,14294648,95083521,19048609,92146306,88003096,94514269,87697352,17971146,92500768,92801207,87906652,92170354,94185669,19043187,20739895,19043387,94224220,93795134,19043185,17971287,92097293,92254685,93417831,94987951,44372285,19041151,85628241,47686780,86173098,91849701,92848760,92426540,91401606,92146308,95084837,94289481,88468242,19041160,50540711,20739810,47686729,89828632,94224219,19041161,94460520,19041136,19041153,19042027,72165658,88123553,19041138,19041146,93185582,49231582,19041148,94213967,19041169,93994593,63331863,95074069,85832697,86248146,87105440,90921896,19041150,19041145,91556927,91024699,94991158,92588221,19045651,21175130,95087352,19041195,19041894,93698765,19041816,95089691,88123552,95019242,92146307,87553971,95083436,90683166,19045627,95074677,19177944,19041193,94877063,93240899,47686730,88498584,93163779,19460265,95084836,19829476,19045632,95034204,94948427,19041173,93071175,95083987,94264083,95083520,92027616,32068517,94811810,88391754,93163748,93846824,94761944,88106509,94214052,93473045}'::bigint[]))
17. 20.696 20.696 ↑ 1.0 1 5,174

Index Scan using schedule_pkey on schedule sc (cost=0.43..2.46 rows=1 width=16) (actual time=0.004..0.004 rows=1 loops=5,174)

  • Index Cond: (id = tb.schedule_id)
  • Filter: (department_id = ANY ('{18002,17998,17996,17997,16498,17994,17999,16500,17993,17995}'::bigint[]))
18. 15.522 15.522 ↑ 1.0 1 5,174

Index Scan using idx_employee_id_del on employee em (cost=0.42..2.44 rows=1 width=19) (actual time=0.003..0.003 rows=1 loops=5,174)

  • Index Cond: (id = tb.employee_id)
19. 15.522 15.522 ↑ 1.0 1 5,174

Index Scan using i_position_id on "position" po (cost=0.42..2.44 rows=1 width=24) (actual time=0.003..0.003 rows=1 loops=5,174)

  • Index Cond: (id = tb.position_id)
  • Filter: (tb.location_id = location_id)
20. 10.348 10.348 ↑ 1.0 1 5,174

Index Scan using idx_location_id_del on location lo (cost=0.29..2.29 rows=1 width=21) (actual time=0.002..0.002 rows=1 loops=5,174)

  • Index Cond: (id = po.location_id)
21. 3,844.282 3,844.282 ↓ 23.4 632 5,174

Index Scan using department_location_dep_idx on department_location de_lo (cost=0.42..38.22 rows=27 width=16) (actual time=0.010..0.743 rows=632 loops=5,174)

  • Index Cond: (department_id = sc.department_id)
  • Filter: (deleted = 'N'::bpchar)
  • Rows Removed by Filter: 1089
22. 15.522 15.522 ↑ 1.0 1 5,174

Index Only Scan using i_department_id on department dep (cost=0.29..2.27 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=5,174)

  • Index Cond: (id = sc.department_id)
  • Heap Fetches: 5174
23. 15.522 15.522 ↑ 1.0 1 5,174

Index Scan using corporation_pkey on corporation co (cost=0.29..2.30 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=5,174)

  • Index Cond: (id = lo.corporation_id)
  • Filter: (deleted = 'N'::bpchar)
24. 15.522 15.522 ↑ 1.0 1 5,174

Index Scan using position_code_pkey on position_code po_code (cost=0.42..2.44 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=5,174)

  • Index Cond: (id = po.position_code_id)
  • Filter: (deleted = 'N'::bpchar)
25. 15.522 15.522 ↑ 1.0 1 5,174

Index Scan using i_au_id_del on app_user ap (cost=0.42..2.44 rows=1 width=23) (actual time=0.003..0.003 rows=1 loops=5,174)

  • Index Cond: (id = em.user_id)
26. 20.696 20.696 ↑ 22.0 1 5,174

Index Scan using user_loc_user_id on user_location ul (cost=0.42..23.09 rows=22 width=16) (actual time=0.004..0.004 rows=1 loops=5,174)

  • Index Cond: (user_id = em.user_id)
  • Filter: ((termination_date IS NULL) OR (termination_date >= '2020-03-01 00:00:00'::timestamp without time zone))
  • Rows Removed by Filter: 0
27.          

CTE prior_schedule

28. 14.164 27,710.229 ↓ 2,261.0 2,261 1

GroupAggregate (cost=1,926,612.35..1,926,616.07 rows=1 width=688) (actual time=26,944.770..27,710.229 rows=2,261 loops=1)

  • Group Key: ti.payroll_id, ti.ename, ti.start_date, ti.end_date, ti.end_time, ti.start_time, ti.employee_id, ti.location_id, ti.shift_type, ti.extra, ti.id, ti.cost
29. 7.223 26,945.413 ↓ 226.1 2,261 1

Sort (cost=1,926,612.35..1,926,612.38 rows=10 width=620) (actual time=26,944.645..26,945.413 rows=2,261 loops=1)

  • Sort Key: ti.payroll_id, ti.ename, ti.start_date, ti.end_date, ti.end_time, ti.start_time, ti.employee_id, ti.location_id, ti.shift_type, ti.extra, ti.id, ti.cost
  • Sort Method: quicksort Memory: 414kB
30. 6,542.568 26,938.190 ↓ 226.1 2,261 1

Hash Right Join (cost=5.12..1,926,612.19 rows=10 width=620) (actual time=26,937.391..26,938.190 rows=2,261 loops=1)

  • Hash Cond: (bt.timeblock_id = ti.id)
  • Join Filter: ((ti.confirmed = 'Y'::bpchar) AND CASE WHEN ((date_part('timezone'::text, CURRENT_TIME) / '3600'::double precision) = '-4'::double precision) THEN CASE WHEN ((tz.timezone_offset = '-5'::double precision) AND (tz.dst = 'Y'::bpchar)) THEN ((((ti.start_date - '13 days'::interval) - '08:00:00'::interval) >= bt.starttimestamp) AND (((ti.start_date - '13 days'::interval) - '08:00:00'::interval) <= COALESCE(bt.endtimestamp, '3000-12-31 00:00:00'::timestamp without time zone)) AND (((COALESCE(ti.confirmed_date, (ti.start_date)::timestamp without time zone) - '13 days'::interval) - '08:00:00'::interval) >= ti.starttimestamp) AND (((COALESCE(ti.confirmed_date, (ti.start_date)::timestamp without time zone) - '13 days'::interval) - '08:00:00'::interval) <= COALESCE(ti.endtimestamp, '3000-12-31 00:00:00'::timestamp without time zone))) WHEN (((tz.timezone_offset = '-6'::double precision) AND (tz.dst = 'Y'::bpchar)) OR ((tz.timezone_offset = '-5'::double precision) AND (tz.dst = 'N'::bpchar))) THEN ((((ti.start_date - '13 days'::interval) - '07:00:00'::interval) >= bt.starttimestamp) AND (((ti.start_date - '13 days'::interval) - '07:00:00'::interval) <= COALESCE(bt.endtimestamp, '3000-12-31 00:00:00'::timestamp without time zone)) AND (((COALESCE(ti.confirmed_date, (ti.start_date)::timestamp without time zone) - '13 days'::interval) - '07:00:00'::interval) >= ti.starttimestamp) AND (((COALESCE(ti.confirmed_date, (ti.start_date)::timestamp without time zone) - '13 days'::interval) - '07:00:00'::interval) <= COALESCE(ti.endtimestamp, '3000-12-31 00:00:00'::timestamp without time zone))) WHEN (((tz.timezone_offset = '-7'::double precision) AND (tz.dst = 'Y'::bpchar)) OR ((tz.timezone_offset = '-6'::double precision) AND (tz.dst = 'N'::bpchar))) THEN ((((ti.start_date - '13 days'::interval) - '06:00:00'::interval) >= bt.starttimestamp) AND (((ti.start_date - '13 days'::interval) - '06:00:00'::interval) <= COALESCE(bt.endtimestamp, '3000-12-31 00:00:00'::timestamp without time zone)) AND (((COALESCE(ti.confirmed_date, (ti.start_date)::timestamp without time zone) - '13 days'::interval) - '06:00:00'::interval) >= ti.starttimestamp) AND (((COALESCE(ti.confirmed_date, (ti.start_date)::timestamp without time zone) - '13 days'::interval) - '06:00:00'::interval) <= COALESCE(ti.endtimestamp, '3000-12-31 00:00:00'::timestamp without time zone))) WHEN (((tz.timezone_offset = '-8'::double precision) AND (tz.dst = 'Y'::bpchar)) OR ((tz.timezone_offset = '-7'::double precision) AND (tz.dst = 'N'::bpchar))) THEN ((((ti.start_date - '13 days'::interval) - '05:00:00'::interval) >= bt.starttimestamp) AND (((ti.start_date - '13 days'::interval) - '05:00:00'::interval) <= COALESCE(bt.endtimestamp, '3000-12-31 00:00:00'::timestamp without time zone)) AND (((COALESCE(ti.confirmed_date, (ti.start_date)::timestamp without time zone) - '13 days'::interval) - '05:00:00'::interval) >= ti.starttimestamp) AND (((COALESCE(ti.confirmed_date, (ti.start_date)::timestamp without time zone) - '13 days'::interval) - '05:00:00'::interval) <= COALESCE(ti.endtimestamp, '3000-12-31 00:00:00'::timestamp without time zone))) ELSE NULL::boolean END WHEN ((date_part('timezone'::text, CURRENT_TIME) / '3600'::double precision) = '-6'::double precision) THEN CASE WHEN (tz.timezone_offset = '-5'::double precision) THEN ((((ti.start_date - '13 days'::interval) - '08:00:00'::interval) >= bt.starttimestamp) AND (((ti.start_date - '13 days'::interval) - '08:00:00'::interval) <= COALESCE(bt.endtimestamp, '3000-12-31 00:00:00'::timestamp without time zone)) AND (((COALESCE(ti.confirmed_date, (ti.start_date)::timestamp without time zone) - '13 days'::interval) - '08:00:00'::interval) >= ti.starttimestamp) AND (((COALESCE(ti.confirmed_date, (ti.start_date)::timestamp without time zone) - '13 days'::interval) - '08:00:00'::interval) <= COALESCE(ti.endtimestamp, '3000-12-31 00:00:00'::timestamp without time zone))) WHEN (tz.timezone_offset = '-6'::double precision) THEN ((((ti.start_date - '13 days'::interval) - '07:00:00'::interval) >= bt.starttimestamp) AND (((ti.start_date - '13 days'::interval) - '07:00:00'::interval) <= COALESCE(bt.endtimestamp, '3000-12-31 00:00:00'::timestamp without time zone)) AND (((COALESCE(ti.confirmed_date, (ti.start_date)::timestamp without time zone) - '13 days'::interval) - '07:00:00'::interval) >= ti.starttimestamp) AND (((COALESCE(ti.confirmed_date, (ti.start_date)::timestamp without time zone) - '13 days'::interval) - '07:00:00'::interval) <= COALESCE(ti.endtimestamp, '3000-12-31 00:00:00'::timestamp without time zone))) WHEN (tz.timezone_offset = '-7'::double precision) THEN ((((ti.start_date - '13 days'::interval) - '06:00:00'::interval) >= bt.starttimestamp) AND (((ti.start_date - '13 days'::interval) - '06:00:00'::interval) <= COALESCE(bt.endtimestamp, '3000-12-31 00:00:00'::timestamp without time zone)) AND (((COALESCE(ti.confirmed_date, (ti.start_date)::timestamp without time zone) - '13 days'::interval) - '06:00:00'::interval) >= ti.starttimestamp) AND (((COALESCE(ti.confirmed_date, (ti.start_date)::timestamp without time zone) - '13 days'::interval) - '06:00:00'::interval) <= COALESCE(ti.endtimestamp, '3000-12-31 00:00:00'::timestamp without time zone))) WHEN (tz.timezone_offset = '-8'::double precision) THEN ((((ti.start_date - '13 days'::interval) - '05:00:00'::interval) >= bt.starttimestamp) AND (((ti.start_date - '13 days'::interval) - '05:00:00'::interval) <= COALESCE(bt.endtimestamp, '3000-12-31 00:00:00'::timestamp without time zone)) AND (((COALESCE(ti.confirmed_date, (ti.start_date)::timestamp without time zone) - '13 days'::interval) - '05:00:00'::interval) >= ti.starttimestamp) AND (((COALESCE(ti.confirmed_date, (ti.start_date)::timestamp without time zone) - '13 days'::interval) - '05:00:00'::interval) <= COALESCE(ti.endtimestamp, '3000-12-31 00:00:00'::timestamp without time zone))) ELSE NULL::boolean END ELSE NULL::boolean END)
  • Rows Removed by Join Filter: 2920
31. 15,798.429 15,798.429 ↑ 1.0 47,752,342 1

Seq Scan on break_time bt (cost=0.00..1,746,897.09 rows=47,920,660 width=28) (actual time=0.075..15,798.429 rows=47,752,342 loops=1)

  • Filter: (paid = 'N'::bpchar)
  • Rows Removed by Filter: 13984691
32. 3.230 4,597.193 ↓ 2,261.0 2,261 1

Hash (cost=5.11..5.11 rows=1 width=658) (actual time=4,597.193..4,597.193 rows=2,261 loops=1)

  • Buckets: 4096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 393kB
33. 15.941 4,593.963 ↓ 2,261.0 2,261 1

Nested Loop Left Join (cost=0.85..5.11 rows=1 width=658) (actual time=88.668..4,593.963 rows=2,261 loops=1)

  • Filter: CASE WHEN ((date_part('timezone'::text, CURRENT_TIME) / '3600'::double precision) = '-4'::double precision) THEN CASE WHEN ((tz.timezone_offset = '-5'::double precision) AND (tz.dst = 'Y'::bpchar)) THEN ((((ti.start_date - '13 days'::interval) - '08:00:00'::interval) >= ti.starttimestamp) AND (((ti.start_date - '13 days'::interval) - '08:00:00'::interval) <= COALESCE(ti.endtimestamp, '3000-12-31 00:00:00'::timestamp without time zone))) WHEN (((tz.timezone_offset = '-6'::double precision) AND (tz.dst = 'Y'::bpchar)) OR ((tz.timezone_offset = '-5'::double precision) AND (tz.dst = 'N'::bpchar))) THEN ((((ti.start_date - '13 days'::interval) - '07:00:00'::interval) >= ti.starttimestamp) AND (((ti.start_date - '13 days'::interval) - '07:00:00'::interval) <= COALESCE(ti.endtimestamp, '3000-12-31 00:00:00'::timestamp without time zone))) WHEN (((tz.timezone_offset = '-7'::double precision) AND (tz.dst = 'Y'::bpchar)) OR ((tz.timezone_offset = '-6'::double precision) AND (tz.dst = 'N'::bpchar))) THEN ((((ti.start_date - '13 days'::interval) - '06:00:00'::interval) >= ti.starttimestamp) AND (((ti.start_date - '13 days'::interval) - '06:00:00'::interval) <= COALESCE(ti.endtimestamp, '3000-12-31 00:00:00'::timestamp without time zone))) WHEN (((tz.timezone_offset = '-8'::double precision) AND (tz.dst = 'Y'::bpchar)) OR ((tz.timezone_offset = '-7'::double precision) AND (tz.dst = 'N'::bpchar))) THEN ((((ti.start_date - '13 days'::interval) - '05:00:00'::interval) >= ti.starttimestamp) AND (((ti.start_date - '13 days'::interval) - '05:00:00'::interval) <= COALESCE(ti.endtimestamp, '3000-12-31 00:00:00'::timestamp without time zone))) ELSE NULL::boolean END WHEN ((date_part('timezone'::text, CURRENT_TIME) / '3600'::double precision) = '-6'::double precision) THEN CASE WHEN (tz.timezone_offset = '-5'::double precision) THEN ((((ti.start_date - '13 days'::interval) - '08:00:00'::interval) >= ti.starttimestamp) AND (((ti.start_date - '13 days'::interval) - '08:00:00'::interval) <= COALESCE(ti.endtimestamp, '3000-12-31 00:00:00'::timestamp without time zone))) WHEN (tz.timezone_offset = '-6'::double precision) THEN ((((ti.start_date - '13 days'::interval) - '07:00:00'::interval) >= ti.starttimestamp) AND (((ti.start_date - '13 days'::interval) - '07:00:00'::interval) <= COALESCE(ti.endtimestamp, '3000-12-31 00:00:00'::timestamp without time zone))) WHEN (tz.timezone_offset = '-7'::double precision) THEN ((((ti.start_date - '13 days'::interval) - '06:00:00'::interval) >= ti.starttimestamp) AND (((ti.start_date - '13 days'::interval) - '06:00:00'::interval) <= COALESCE(ti.endtimestamp, '3000-12-31 00:00:00'::timestamp without time zone))) WHEN (tz.timezone_offset = '-8'::double precision) THEN ((((ti.start_date - '13 days'::interval) - '05:00:00'::interval) >= ti.starttimestamp) AND (((ti.start_date - '13 days'::interval) - '05:00:00'::interval) <= COALESCE(ti.endtimestamp, '3000-12-31 00:00:00'::timestamp without time zone))) ELSE NULL::boolean END ELSE NULL::boolean END
  • Rows Removed by Filter: 2725
34. 6.212 4,543.120 ↓ 4,986.0 4,986 1

Nested Loop (cost=0.43..2.47 rows=1 width=696) (actual time=68.888..4,543.120 rows=4,986 loops=1)

35. 4,516.964 4,516.964 ↓ 4,986.0 4,986 1

CTE Scan on timeblocks ti (cost=0.00..0.02 rows=1 width=704) (actual time=68.860..4,516.964 rows=4,986 loops=1)

36. 19.944 19.944 ↑ 1.0 1 4,986

Index Only Scan using schedule_pkey on schedule sc_1 (cost=0.43..2.45 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=4,986)

  • Index Cond: (id = ti.schedule_id)
  • Heap Fetches: 4986
37. 34.902 34.902 ↑ 1.0 1 4,986

Index Scan using timezone_postal_idx on timezone tz (cost=0.43..2.45 rows=1 width=17) (actual time=0.006..0.007 rows=1 loops=4,986)

  • Index Cond: ((postal_code)::text = split_part((ti.zip)::text, '-'::text, 1))
38.          

SubPlan (for GroupAggregate)

39. 0.000 750.652 ↑ 1.0 1 2,261

Limit (cost=3.04..3.29 rows=1 width=8) (actual time=0.332..0.332 rows=1 loops=2,261)

40.          

CTE activetimeblockid

41. 4.179 748.391 ↑ 11.0 1 2,261

Recursive Union (cost=0.00..3.04 rows=11 width=24) (actual time=0.303..0.331 rows=1 loops=2,261)

42. 741.608 741.608 ↑ 1.0 1 2,261

CTE Scan on timeblocks tb_1 (cost=0.00..0.02 rows=1 width=24) (actual time=0.303..0.328 rows=1 loops=2,261)

  • Filter: (id = ti.id)
  • Rows Removed by Filter: 2665
43. 0.456 2.604 ↑ 1.0 1 372

Hash Join (cost=0.03..0.28 rows=1 width=24) (actual time=0.007..0.007 rows=1 loops=372)

  • Hash Cond: (tbb.id = tb_2.parent_id)
44. 0.000 0.000 ↑ 10.0 1 372

WorkTable Scan on activetimeblockid tbb (cost=0.00..0.20 rows=10 width=8) (actual time=0.000..0.000 rows=1 loops=372)

45. 0.689 2.148 ↓ 2,367.0 2,367 1

Hash (cost=0.02..0.02 rows=1 width=24) (actual time=2.148..2.148 rows=2,367 loops=1)

  • Buckets: 4096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 148kB
46. 1.459 1.459 ↓ 4,986.0 4,986 1

CTE Scan on timeblocks tb_2 (cost=0.00..0.02 rows=1 width=24) (actual time=0.001..1.459 rows=4,986 loops=1)

47. 750.652 750.652 ↑ 1.0 1 2,261

CTE Scan on activetimeblockid (cost=0.00..0.25 rows=1 width=8) (actual time=0.332..0.332 rows=1 loops=2,261)

  • Filter: (deleted = 'N'::bpchar)
  • Rows Removed by Filter: 0
Planning time : 59.318 ms
Execution time : 27,717.191 ms