explain.depesz.com

PostgreSQL's explain analyze made readable

Result: X1e5

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 17.788 288.926 ↓ 12,406.0 12,406 1

Nested Loop Left Join (cost=5.14..59.06 rows=1 width=14) (actual time=0.043..288.926 rows=12,406 loops=1)

2. 90.816 223.750 ↓ 11,847.0 11,847 1

Nested Loop Left Join (cost=4.85..50.75 rows=1 width=32) (actual time=0.035..223.750 rows=11,847 loops=1)

  • Join Filter: (u.userid = su.userid)
  • Rows Removed by Join Filter: 292227
3. 3.715 14.514 ↓ 11,842.0 11,842 1

Nested Loop (cost=4.57..45.86 rows=1 width=13) (actual time=0.029..14.514 rows=11,842 loops=1)

4. 0.485 0.485 ↓ 191.0 382 1

Seq Scan on users u (cost=0.00..12.91 rows=2 width=17) (actual time=0.007..0.485 rows=382 loops=1)

  • Filter: (COALESCE((disabled)::integer, 0) = 0)
  • Rows Removed by Filter: 12
5. 4.584 10.314 ↓ 1.3 31 382

Bitmap Heap Scan on calendar c (cost=4.57..16.25 rows=23 width=18) (actual time=0.020..0.027 rows=31 loops=382)

  • Recheck Cond: (((calendar)::text = (COALESCE(u.calendar, 'Default'::character varying))::text) AND (regday >= '2019-05-01'::date) AND (regday <= '2019-05-31'::date))
  • Heap Blocks: exact=1143
6. 5.730 5.730 ↓ 1.3 31 382

Bitmap Index Scan on calendar_pkey (cost=0.00..4.56 rows=23 width=0) (actual time=0.015..0.015 rows=31 loops=382)

  • Index Cond: (((calendar)::text = (COALESCE(u.calendar, 'Default'::character varying))::text) AND (regday >= '2019-05-01'::date) AND (regday <= '2019-05-31'::date))
7. 118.420 118.420 ↓ 1.7 25 11,842

Index Scan using scheduleuser_regday on scheduleuser su (cost=0.28..4.70 rows=15 width=32) (actual time=0.003..0.010 rows=25 loops=11,842)

  • Index Cond: (c.regday = regday)
8. 47.388 47.388 ↓ 0.0 0 11,847

Index Only Scan using attendencelog_pkey on attendencelog al (cost=0.29..8.30 rows=1 width=21) (actual time=0.004..0.004 rows=0 loops=11,847)

  • Index Cond: ((userid = u.userid) AND (regday = c.regday))
  • Heap Fetches: 1122