explain.depesz.com

PostgreSQL's explain analyze made readable

Result: A5Dd

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 31,344.489 ↓ 0.0 0 1

GroupAggregate (cost=9,992.11..9,992.13 rows=1 width=12) (actual time=31,344.489..31,344.489 rows=0 loops=1)

  • Group Key: tb.start_date
2. 0.011 31,344.487 ↓ 0.0 0 1

Sort (cost=9,992.11..9,992.12 rows=1 width=12) (actual time=31,344.487..31,344.487 rows=0 loops=1)

  • Sort Key: tb.start_date
  • Sort Method: quicksort Memory: 25kB
3. 0.002 31,344.476 ↓ 0.0 0 1

Nested Loop (cost=7,947.35..9,992.10 rows=1 width=12) (actual time=31,344.476..31,344.476 rows=0 loops=1)

4. 0.000 31,344.474 ↓ 0.0 0 1

Nested Loop (cost=7,946.92..9,989.46 rows=1 width=20) (actual time=31,344.474..31,344.474 rows=0 loops=1)

5. 0.002 31,344.474 ↓ 0.0 0 1

Nested Loop (cost=7,946.63..9,986.94 rows=1 width=28) (actual time=31,344.474..31,344.474 rows=0 loops=1)

  • Join Filter: (loc.id = ul.location_id)
6. 0.001 31,344.472 ↓ 0.0 0 1

Nested Loop (cost=7,946.20..9,602.55 rows=1 width=68) (actual time=31,344.472..31,344.472 rows=0 loops=1)

7. 0.000 31,344.471 ↓ 0.0 0 1

Nested Loop (cost=7,945.77..9,599.90 rows=1 width=60) (actual time=31,344.471..31,344.471 rows=0 loops=1)

8. 1,178.463 31,344.471 ↓ 0.0 0 1

Nested Loop (cost=7,945.35..9,597.26 rows=1 width=60) (actual time=31,344.471..31,344.471 rows=0 loops=1)

9. 2.591 14.733 ↓ 345.0 345 1

Nested Loop (cost=0.85..1,488.59 rows=1 width=24) (actual time=0.054..14.733 rows=345 loops=1)

10. 1.612 1.612 ↑ 1.2 351 1

Index Scan using i_loc_corp_id on location loc (cost=0.29..340.87 rows=411 width=16) (actual time=0.028..1.612 rows=351 loops=1)

  • Index Cond: (corporation_id = 70683)
11. 10.530 10.530 ↑ 1.0 1 351

Index Scan using idx_loc_flag_del on location_flag lf (cost=0.56..2.78 rows=1 width=8) (actual time=0.027..0.030 rows=1 loops=351)

  • Index Cond: ((location_id = loc.id) AND (flag_id = 14))
  • Filter: (value = 'Yes'::text)
  • Rows Removed by Filter: 0
12. 867.675 30,151.275 ↓ 0.0 0 345

Bitmap Heap Scan on timeblock tb (cost=7,944.50..8,108.27 rows=40 width=36) (actual time=87.395..87.395 rows=0 loops=345)

  • Recheck Cond: ((location_id = loc.id) AND (start_date >= '2019-11-01'::date) AND (start_date <= '2019-11-30'::date) AND (deleted = 'N'::bpchar))
  • Filter: ((date_published IS NOT NULL) AND (last_published = 'N'::bpchar))
  • Rows Removed by Filter: 1024
  • Heap Blocks: exact=198680
13. 1,052.555 29,283.600 ↓ 0.0 0 345

BitmapAnd (cost=7,944.50..7,944.50 rows=146 width=0) (actual time=84.880..84.880 rows=0 loops=345)

14. 4,937.985 4,937.985 ↓ 5.0 121,440 345

Bitmap Index Scan on i_timeblock_loc (cost=0.00..255.23 rows=24,128 width=0) (actual time=14.313..14.313 rows=121,440 loops=345)

  • Index Cond: (location_id = loc.id)
15. 23,293.060 23,293.060 ↑ 1.0 576,662 340

Bitmap Index Scan on i_timeblock_start (cost=0.00..7,649.16 rows=587,540 width=0) (actual time=68.509..68.509 rows=576,662 loops=340)

  • Index Cond: ((start_date >= '2019-11-01'::date) AND (start_date <= '2019-11-30'::date))
16. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_employee_id_del on employee emp (cost=0.42..2.64 rows=1 width=16) (never executed)

  • Index Cond: (id = tb.employee_id)
17. 0.000 0.000 ↓ 0.0 0

Index Only Scan using i_au_id_del on app_user au (cost=0.42..2.64 rows=1 width=8) (never executed)

  • Index Cond: (id = emp.user_id)
  • Filter: (id <> 12349808)
  • Heap Fetches: 0
18. 0.000 0.000 ↓ 0.0 0

Index Scan using user_loc_user_id_all_index on user_location ul (cost=0.43..373.46 rows=875 width=16) (never executed)

  • Index Cond: (user_id = au.id)
19. 0.000 0.000 ↓ 0.0 0

Index Only Scan using corporation_pkey on corporation cor (cost=0.29..2.51 rows=1 width=8) (never executed)

  • Index Cond: (id = 70683)
  • Heap Fetches: 0
20. 0.000 0.000 ↓ 0.0 0

Index Only Scan using i_schedule_idtempn on schedule sch (cost=0.43..2.64 rows=1 width=8) (never executed)

  • Index Cond: (id = tb.schedule_id)