explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9VPk

Settings
# exclusive inclusive rows x rows loops node
1. 0.017 22,404.752 ↑ 200.0 1 1

GroupAggregate (cost=24,672,259.81..24,672,562.81 rows=200 width=48) (actual time=22,404.752..22,404.752 rows=1 loops=1)

  • Group Key: a.groupby
2. 0.037 22,404.735 ↑ 2,105.3 19 1

Sort (cost=24,672,259.81..24,672,359.81 rows=40,000 width=40) (actual time=22,404.733..22,404.735 rows=19 loops=1)

  • Sort Key: a.groupby
  • Sort Method: quicksort Memory: 25kB
3. 0.020 22,404.698 ↑ 2,105.3 19 1

Subquery Scan on a (cost=23,803,526.00..24,669,202.27 rows=40,000 width=40) (actual time=5,384.058..22,404.698 rows=19 loops=1)

4. 16,846.260 22,404.678 ↑ 2,105.3 19 1

GroupAggregate (cost=23,803,526.00..24,668,802.27 rows=40,000 width=44) (actual time=5,384.057..22,404.678 rows=19 loops=1)

  • Group Key: t2.date, t1.groupby
5. 3,422.957 5,558.418 ↑ 20.6 4,190,170 1

Sort (cost=23,803,526.00..24,019,745.06 rows=86,487,627 width=68) (actual time=4,486.865..5,558.418 rows=4,190,170 loops=1)

  • Sort Key: t2.date, t1.groupby
  • Sort Method: external merge Disk: 102432kB
6. 669.955 2,135.461 ↑ 20.6 4,190,170 1

Merge Join (cost=18,857.78..1,759,832.77 rows=86,487,627 width=68) (actual time=1,041.537..2,135.461 rows=4,190,170 loops=1)

  • Merge Cond: ((t1.studentid)::text = ((t2.studentid)::text))
7. 46.620 46.620 ↓ 1.9 225,528 1

Index Scan using temp1_index2_indicator_oel_l4l on temp1 t1 (cost=0.42..9,978.37 rows=116,397 width=64) (actual time=0.088..46.620 rows=225,528 loops=1)

8. 196.059 1,418.886 ↓ 28.6 4,245,328 1

Materialize (cost=18,857.36..19,600.40 rows=148,608 width=12) (actual time=1,041.444..1,418.886 rows=4,245,328 loops=1)

9. 1,153.604 1,222.827 ↓ 1.9 280,686 1

Sort (cost=18,857.36..19,228.88 rows=148,608 width=12) (actual time=1,041.442..1,222.827 rows=280,686 loops=1)

  • Sort Key: ((t2.studentid)::text)
  • Sort Method: external merge Disk: 9000kB
10. 69.223 69.223 ↓ 1.9 280,701 1

Seq Scan on temp2 t2 (cost=0.00..3,550.08 rows=148,608 width=12) (actual time=0.019..69.223 rows=280,701 loops=1)

Planning time : 0.220 ms