explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Wpv5

Settings
# exclusive inclusive rows x rows loops node
1. 0.067 25,375.476 ↑ 200.0 1 1

GroupAggregate (cost=23,810,612.14..24,676,491.41 rows=200 width=48) (actual time=25,375.476..25,375.476 rows=1 loops=1)

  • Group Key: t1.groupby
2. 17,284.144 25,375.409 ↑ 2,105.3 19 1

GroupAggregate (cost=23,810,612.14..24,675,888.41 rows=40,000 width=44) (actual time=7,346.804..25,375.409 rows=19 loops=1)

  • Group Key: t1.groupby, t2.date
3. 5,024.951 8,091.265 ↑ 20.6 4,190,170 1

Sort (cost=23,810,612.14..24,026,831.20 rows=86,487,627 width=68) (actual time=6,410.570..8,091.265 rows=4,190,170 loops=1)

  • Sort Key: t1.groupby, t2.date
  • Sort Method: external merge Disk: 102432kB
4. 671.217 3,066.314 ↑ 20.6 4,190,170 1

Merge Join (cost=35,630.88..1,766,918.91 rows=86,487,627 width=68) (actual time=1,897.675..3,066.314 rows=4,190,170 loops=1)

  • Merge Cond: ((t1.studentid)::text = ((t2.studentid)::text))
5. 938.365 972.124 ↓ 1.9 225,528 1

Sort (cost=16,773.52..17,064.51 rows=116,397 width=64) (actual time=858.560..972.124 rows=225,528 loops=1)

  • Sort Key: t1.studentid
  • Sort Method: external merge Disk: 4616kB
6. 33.759 33.759 ↓ 1.9 225,528 1

Seq Scan on temp1 t1 (cost=0.00..2,600.97 rows=116,397 width=64) (actual time=0.031..33.759 rows=225,528 loops=1)

7. 193.474 1,422.973 ↓ 28.6 4,245,328 1

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

8. 1,163.331 1,229.499 ↓ 1.9 280,686 1

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

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

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

Planning time : 0.126 ms