explain.depesz.com

PostgreSQL's explain analyze made readable

Result: pLwA

Settings
# exclusive inclusive rows x rows loops node
1. 0.022 10,324.154 ↑ 1.0 10 1

Limit (cost=294,718.43..294,718.46 rows=10 width=172) (actual time=10,324.123..10,324.154 rows=10 loops=1)

2. 556.239 10,324.132 ↑ 34,746.5 10 1

Sort (cost=294,718.43..295,587.10 rows=347,465 width=172) (actual time=10,324.120..10,324.132 rows=10 loops=1)

  • Sort Key: t1.sitepageid
  • Sort Method: top-N heapsort Memory: 27kB
3. 884.137 9,767.893 ↓ 1.0 350,119 1

Hash Left Join (cost=259,905.23..287,209.84 rows=347,465 width=172) (actual time=7,609.401..9,767.893 rows=350,119 loops=1)

  • Hash Cond: (t1.sitepageid = a.sitepageid)
4. 720.183 7,291.860 ↓ 1.0 350,119 1

Hash Right Join (cost=234,023.50..251,330.79 rows=347,465 width=172) (actual time=6,017.486..7,291.860 rows=350,119 loops=1)

  • Hash Cond: (t15.sitepageid = t1.sitepageid)
5. 147.210 632.798 ↓ 1.0 65,338 1

Subquery Scan on t15 (cost=0.42..7,461.78 rows=63,122 width=8) (actual time=0.034..632.798 rows=65,338 loops=1)

6. 272.895 485.588 ↓ 1.0 65,338 1

GroupAggregate (cost=0.42..6,830.56 rows=63,122 width=48) (actual time=0.032..485.588 rows=65,338 loops=1)

  • Group Key: pageredirectdetail.taskid, pageredirectdetail.sitepageid
7. 212.693 212.693 ↑ 1.0 153,946 1

Index Only Scan using pageredirectdetail_urlid_idx on pageredirectdetail (cost=0.42..5,429.61 rows=153,946 width=16) (actual time=0.018..212.693 rows=153,946 loops=1)

  • Heap Fetches: 59
8. 938.016 5,938.879 ↓ 1.0 350,119 1

Hash (cost=221,195.77..221,195.77 rows=347,465 width=172) (actual time=5,938.879..5,938.879 rows=350,119 loops=1)

  • Buckets: 32768 Batches: 16 Memory Usage: 4391kB
9. 870.279 5,000.863 ↓ 1.0 350,119 1

Subquery Scan on t1 (cost=0.43..221,195.77 rows=347,465 width=172) (actual time=0.072..5,000.863 rows=350,119 loops=1)

10. 4,130.584 4,130.584 ↓ 1.0 350,119 1

Index Scan using sitepage_taskid_idx on sitepage (cost=0.43..217,721.12 rows=347,465 width=326) (actual time=0.068..4,130.584 rows=350,119 loops=1)

  • Index Cond: (taskid = 51312)
11. 96.722 1,591.896 ↓ 84.9 65,338 1

Hash (cost=25,872.11..25,872.11 rows=770 width=8) (actual time=1,591.896..1,591.896 rows=65,338 loops=1)

  • Buckets: 65536 (originally 1024) Batches: 1 (originally 1) Memory Usage: 3065kB
12. 272.706 1,495.174 ↓ 84.9 65,338 1

Subquery Scan on a (cost=20,484.00..25,872.11 rows=770 width=8) (actual time=555.161..1,495.174 rows=65,338 loops=1)

  • Filter: (a.rownum = 1)
  • Rows Removed by Filter: 88608
13. 450.390 1,222.468 ↑ 1.0 153,946 1

WindowAgg (cost=20,484.00..23,947.78 rows=153,946 width=542) (actual time=555.153..1,222.468 rows=153,946 loops=1)

14. 563.665 772.078 ↑ 1.0 153,946 1

Sort (cost=20,484.00..20,868.86 rows=153,946 width=18) (actual time=555.132..772.078 rows=153,946 loops=1)

  • Sort Key: pageredirectdetail_1.taskid, pageredirectdetail_1.sitepageid, pageredirectdetail_1.sort DESC
  • Sort Method: external sort Disk: 4216kB
15. 208.413 208.413 ↑ 1.0 153,946 1

Seq Scan on pageredirectdetail pageredirectdetail_1 (cost=0.00..4,059.46 rows=153,946 width=18) (actual time=0.011..208.413 rows=153,946 loops=1)

Planning time : 2.413 ms
Execution time : 10,325.432 ms