explain.depesz.com

PostgreSQL's explain analyze made readable

Result: l1AP

Settings
# exclusive inclusive rows x rows loops node
1. 0.108 90,876.038 ↑ 1.0 25 1

Limit (cost=1,170,842.61..1,170,868.56 rows=25 width=791) (actual time=90,143.507..90,876.038 rows=25 loops=1)

2. 0.101 90,875.930 ↑ 235,090.0 25 1

Nested Loop Left Join (cost=1,170,842.61..7,271,973.42 rows=5,877,250 width=791) (actual time=90,143.503..90,875.930 rows=25 loops=1)

3. 0.116 90,875.704 ↑ 235,090.0 25 1

Nested Loop (cost=1,170,842.33..5,508,782.48 rows=5,877,250 width=750) (actual time=90,143.466..90,875.704 rows=25 loops=1)

4. 2,150.796 90,875.213 ↑ 235,090.0 25 1

Merge Semi Join (cost=1,170,841.90..2,262,400.71 rows=5,877,250 width=75) (actual time=90,143.399..90,875.213 rows=25 loops=1)

  • Merge Cond: (omaha_apprequest.id = v0.id)
5. 2,404.926 2,404.926 ↑ 4.6 2,538,397 1

Index Scan using omaha_apprequest_pkey on omaha_apprequest (cost=0.43..457,528.22 rows=11,791,052 width=75) (actual time=0.010..2,404.926 rows=2,538,397 loops=1)

6. 0.063 86,319.491 ↑ 235,090.0 25 1

Materialize (cost=1,170,841.46..1,701,929.24 rows=5,877,250 width=8) (actual time=85,946.939..86,319.491 rows=25 loops=1)

7. 2,130.879 86,319.428 ↑ 235,090.0 25 1

Merge Join (cost=1,170,841.46..1,687,236.11 rows=5,877,250 width=8) (actual time=85,946.930..86,319.428 rows=25 loops=1)

  • Merge Cond: (v0.id = "ANY_subquery".id)
8. 2,616.411 2,616.411 ↑ 4.6 2,534,277 1

Index Scan using omaha_apprequest_pkey on omaha_apprequest v0 (cost=0.43..487,005.85 rows=11,754,500 width=4) (actual time=0.009..2,616.411 rows=2,534,277 loops=1)

  • Filter: ((appid)::text = '{98DA7DF2-4E3E-4744-9DE6-EC931886ABAB}'::text)
  • Rows Removed by Filter: 4120
9. 288.067 81,572.138 ↑ 7.7 26 1

Sort (cost=1,170,841.03..1,170,841.53 rows=200 width=4) (actual time=81,572.101..81,572.138 rows=26 loops=1)

  • Sort Key: "ANY_subquery".id
  • Sort Method: quicksort Memory: 24617kB
10. 637.918 81,284.071 ↓ 1,315.0 263,009 1

HashAggregate (cost=1,170,831.39..1,170,833.39 rows=200 width=4) (actual time=80,989.649..81,284.071 rows=263,009 loops=1)

  • Group Key: "ANY_subquery".id
11. 447.416 80,646.153 ↓ 2.7 263,009 1

Subquery Scan on ANY_subquery (cost=1,165,676.71..1,170,583.74 rows=99,057 width=4) (actual time=79,399.936..80,646.153 rows=263,009 loops=1)

12. 467.686 80,198.737 ↓ 2.7 263,009 1

Unique (cost=1,165,676.71..1,169,593.17 rows=99,057 width=45) (actual time=79,399.932..80,198.737 rows=263,009 loops=1)

13. 1,304.315 79,731.051 ↑ 2.9 274,353 1

Sort (cost=1,165,676.71..1,167,634.94 rows=783,292 width=45) (actual time=79,399.929..79,731.051 rows=274,353 loops=1)

  • Sort Key: omaha_request_1.userid, omaha_request_1.created DESC
  • Sort Method: quicksort Memory: 33692kB
14. 12,799.018 78,426.736 ↑ 2.9 274,353 1

Hash Join (cost=686,429.90..1,088,995.60 rows=783,292 width=45) (actual time=53,528.801..78,426.736 rows=274,353 loops=1)

  • Hash Cond: (omaha_request_1.id = u0.request_id)
15. 12,104.169 12,104.169 ↑ 1.0 11,789,679 1

Seq Scan on omaha_request omaha_request_1 (cost=0.00..350,506.29 rows=11,793,729 width=45) (actual time=0.005..12,104.169 rows=11,789,679 loops=1)

16. 322.344 53,523.549 ↑ 2.9 274,353 1

Hash (cost=676,638.75..676,638.75 rows=783,292 width=8) (actual time=53,523.548..53,523.549 rows=274,353 loops=1)

  • Buckets: 1048576 Batches: 1 Memory Usage: 18909kB
17. 12,932.254 53,201.205 ↑ 2.9 274,353 1

Hash Join (cost=355,335.87..676,638.75 rows=783,292 width=8) (actual time=28,786.832..53,201.205 rows=274,353 loops=1)

  • Hash Cond: (u0.id = u1.apprequest_id)
18. 11,487.689 11,487.689 ↑ 1.0 11,789,679 1

Seq Scan on omaha_apprequest u0 (cost=0.00..269,253.52 rows=11,791,052 width=8) (actual time=0.011..11,487.689 rows=11,789,679 loops=1)

19. 371.063 28,781.262 ↑ 2.9 274,353 1

Hash (cost=345,544.72..345,544.72 rows=783,292 width=4) (actual time=28,781.260..28,781.262 rows=274,353 loops=1)

  • Buckets: 1048576 Batches: 1 Memory Usage: 17838kB
20. 14,615.313 28,410.199 ↑ 2.9 274,353 1

Hash Join (cost=111,875.74..345,544.72 rows=783,292 width=4) (actual time=1,332.651..28,410.199 rows=274,353 loops=1)

  • Hash Cond: (u1.event_id = u2.id)
21. 12,467.249 12,467.249 ↓ 1.0 11,789,679 1

Seq Scan on omaha_apprequest_events u1 (cost=0.00..181,624.77 rows=11,789,677 width=8) (actual time=0.013..12,467.249 rows=11,789,679 loops=1)

22. 351.426 1,327.637 ↑ 2.9 274,353 1

Hash (cost=102,084.59..102,084.59 rows=783,292 width=4) (actual time=1,327.635..1,327.637 rows=274,353 loops=1)

  • Buckets: 1048576 Batches: 1 Memory Usage: 17838kB
23. 888.464 976.211 ↑ 2.9 274,353 1

Bitmap Heap Scan on omaha_event u2 (cost=15,368.37..102,084.59 rows=783,292 width=4) (actual time=100.059..976.211 rows=274,353 loops=1)

  • Recheck Cond: (eventresult = 1)
  • Filter: (eventtype = ANY ('{2,3}'::integer[]))
  • Rows Removed by Filter: 572461
  • Heap Blocks: exact=53618
24. 87.747 87.747 ↓ 1.0 846,814 1

Bitmap Index Scan on omaha_event_eventresult (cost=0.00..15,172.55 rows=821,348 width=0) (actual time=87.746..87.747 rows=846,814 loops=1)

  • Index Cond: (eventresult = 1)
25. 0.375 0.375 ↑ 1.0 1 25

Index Scan using omaha_request_pkey on omaha_request (cost=0.43..0.54 rows=1 width=675) (actual time=0.014..0.015 rows=1 loops=25)

  • Index Cond: (id = omaha_apprequest.request_id)
26. 0.125 0.125 ↑ 1.0 1 25

Index Scan using omaha_os_pkey on omaha_os (cost=0.27..0.29 rows=1 width=41) (actual time=0.004..0.005 rows=1 loops=25)

  • Index Cond: (omaha_request.os_id = id)