explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kXet

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 158.977 ↓ 0.0 0 1

GroupAggregate (cost=33,481,379,159.10..34,511,584,674.70 rows=200 width=80) (actual time=158.977..158.977 rows=0 loops=1)

  • Group Key: a.studentid, a.groupby
  • Filter: ((count(DISTINCT va.date))::numeric > 16.1500000000000000)
2. 0.005 158.976 ↓ 0.0 0 1

Sort (cost=33,481,379,159.10..33,687,420,261.82 rows=82,416,441,088 width=44) (actual time=158.976..158.976 rows=0 loops=1)

  • Sort Key: a.studentid, a.groupby
  • Sort Method: quicksort Memory: 25kB
3. 0.001 158.971 ↓ 0.0 0 1

Merge Join (cost=2,033,415,719.25..3,326,738,112.42 rows=82,416,441,088 width=44) (actual time=158.971..158.971 rows=0 loops=1)

  • Merge Cond: (a.studentid = va.studentid)
4. 0.003 158.970 ↓ 0.0 0 1

Sort (cost=3,289,150.34..3,297,699.62 rows=3,419,714 width=40) (actual time=158.970..158.970 rows=0 loops=1)

  • Sort Key: a.studentid
  • Sort Method: quicksort Memory: 25kB
5. 0.001 158.967 ↓ 0.0 0 1

Hash Left Join (cost=2,022,901.64..2,730,999.28 rows=3,419,714 width=40) (actual time=158.967..158.967 rows=0 loops=1)

  • Hash Cond: (a.studentid = dc.studentid)
6. 158.966 158.966 ↓ 0.0 0 1

Function Scan on ufn_indicators_corefilter a (cost=0.25..10.25 rows=1,000 width=40) (actual time=158.966..158.966 rows=0 loops=1)

7. 0.000 0.000 ↓ 0.0 0

Hash (cost=889,229.39..889,229.39 rows=69,100,000 width=8) (never executed)

8. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.00..889,229.39 rows=69,100,000 width=8) (never executed)

9. 0.000 0.000 ↓ 0.0 0

Function Scan on regexp_split_to_table c (cost=0.00..10.00 rows=1,000 width=0) (never executed)

10. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.00..25,642.14 rows=69,100 width=8) (never executed)

11. 0.000 0.000 ↓ 0.0 0

Seq Scan on discipline dc (cost=0.00..25,296.64 rows=69,100 width=8) (never executed)

  • Filter: ((date >= '2018-08-06'::date) AND (date <= '2019-08-04'::date) AND (accountid = 1))
12. 0.000 0.000 ↓ 0.0 0

Materialize (cost=2,030,126,568.91..2,087,197,297.39 rows=4,820,078 width=12) (never executed)

13. 0.000 0.000 ↓ 0.0 0

Unique (cost=2,030,126,568.91..2,087,137,046.41 rows=4,820,078 width=12) (never executed)

14. 0.000 0.000 ↓ 0.0 0

Sort (cost=2,030,126,568.91..2,049,130,061.41 rows=7,601,397,000 width=12) (never executed)

  • Sort Key: va.studentid, va.date
15. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=218,297.37..133,066,385.79 rows=7,601,397,000 width=12) (never executed)

16. 0.000 0.000 ↓ 0.0 0

Function Scan on regexp_split_to_table c_1 (cost=0.00..10.00 rows=1,000 width=0) (never executed)

17. 0.000 0.000 ↓ 0.0 0

Materialize (cost=218,297.36..988,033.78 rows=7,601,397 width=12) (never executed)

18. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on view_attendanceevents va (cost=218,297.36..912,909.80 rows=7,601,397 width=12) (never executed)

  • Recheck Cond: ((accountid = 1) AND (date >= '2018-08-06'::date) AND (date <= '2019-08-04'::date) AND (date >= '2018-08-06'::date) AND (date <= '2019-08-04'::date))
19. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on view_attendance_idx_accountid_date (cost=0.00..216,397.02 rows=7,601,397 width=0) (never executed)

  • Index Cond: ((accountid = 1) AND (date >= '2018-08-06'::date) AND (date <= '2019-08-04'::date) AND (date >= '2018-08-06'::date) AND (date <= '2019-08-04'::date))