explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PTQY

Settings
# exclusive inclusive rows x rows loops node
1. 0.116 102,311.881 ↑ 1.0 25 1

Limit (cost=1,170,842.61..1,170,883.35 rows=25 width=791) (actual time=101,414.312..102,311.881 rows=25 loops=1)

2. 0.134 102,311.765 ↑ 235,090.0 25 1

Nested Loop Left Join (cost=1,170,842.61..10,749,184.63 rows=5,877,250 width=791) (actual time=101,414.309..102,311.765 rows=25 loops=1)

3. 0.133 102,311.506 ↑ 235,090.0 25 1

Nested Loop (cost=1,170,842.33..8,985,993.68 rows=5,877,250 width=750) (actual time=101,414.275..102,311.506 rows=25 loops=1)

4. 2,776.149 102,311.048 ↑ 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=101,414.230..102,311.048 rows=25 loops=1)

  • Merge Cond: (omaha_apprequest.id = v0.id)
5. 3,119.879 3,119.879 ↑ 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.006..3,119.879 rows=2,538,397 loops=1)

6. 0.067 96,415.020 ↑ 235,090.0 25 1

Materialize (cost=1,170,841.46..1,701,929.24 rows=5,877,250 width=8) (actual time=95,949.611..96,415.020 rows=25 loops=1)

7. 2,625.166 96,414.953 ↑ 235,090.0 25 1

Merge Join (cost=1,170,841.46..1,687,236.11 rows=5,877,250 width=8) (actual time=95,949.602..96,414.953 rows=25 loops=1)

  • Merge Cond: (v0.id = "ANY_subquery".id)
8. 3,225.585 3,225.585 ↑ 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.006..3,225.585 rows=2,534,277 loops=1)

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

Sort (cost=1,170,841.03..1,170,841.53 rows=200 width=4) (actual time=90,564.148..90,564.202 rows=26 loops=1)

  • Sort Key: "ANY_subquery".id
  • Sort Method: quicksort Memory: 24617kB
10. 801.226 90,214.663 ↓ 1,315.0 263,009 1

HashAggregate (cost=1,170,831.39..1,170,833.39 rows=200 width=4) (actual time=89,840.312..90,214.663 rows=263,009 loops=1)

  • Group Key: "ANY_subquery".id
11. 551.210 89,413.437 ↓ 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=87,909.957..89,413.437 rows=263,009 loops=1)

12. 571.041 88,862.227 ↓ 2.7 263,009 1

Unique (cost=1,165,676.71..1,169,593.17 rows=99,057 width=45) (actual time=87,909.953..88,862.227 rows=263,009 loops=1)

13. 1,410.424 88,291.186 ↑ 2.9 274,353 1

Sort (cost=1,165,676.71..1,167,634.94 rows=783,292 width=45) (actual time=87,909.938..88,291.186 rows=274,353 loops=1)

  • Sort Key: omaha_request_1.userid, omaha_request_1.created DESC
  • Sort Method: quicksort Memory: 33692kB
14. 15,319.511 86,880.762 ↑ 2.9 274,353 1

Hash Join (cost=686,429.90..1,088,995.60 rows=783,292 width=45) (actual time=58,623.482..86,880.762 rows=274,353 loops=1)

  • Hash Cond: (omaha_request_1.id = u0.request_id)
15. 12,942.975 12,942.975 ↑ 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.007..12,942.975 rows=11,789,679 loops=1)

16. 389.760 58,618.276 ↑ 2.9 274,353 1

Hash (cost=676,638.75..676,638.75 rows=783,292 width=8) (actual time=58,618.274..58,618.276 rows=274,353 loops=1)

  • Buckets: 1048576 Batches: 1 Memory Usage: 18909kB
17. 15,311.773 58,228.516 ↑ 2.9 274,353 1

Hash Join (cost=355,335.87..676,638.75 rows=783,292 width=8) (actual time=29,996.339..58,228.516 rows=274,353 loops=1)

  • Hash Cond: (u0.id = u1.apprequest_id)
18. 12,926.036 12,926.036 ↑ 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.019..12,926.036 rows=11,789,679 loops=1)

19. 386.850 29,990.707 ↑ 2.9 274,353 1

Hash (cost=345,544.72..345,544.72 rows=783,292 width=4) (actual time=29,990.705..29,990.707 rows=274,353 loops=1)

  • Buckets: 1048576 Batches: 1 Memory Usage: 17838kB
20. 15,437.080 29,603.857 ↑ 2.9 274,353 1

Hash Join (cost=111,875.74..345,544.72 rows=783,292 width=4) (actual time=1,310.659..29,603.857 rows=274,353 loops=1)

  • Hash Cond: (u1.event_id = u2.id)
21. 12,861.644 12,861.644 ↓ 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.016..12,861.644 rows=11,789,679 loops=1)

22. 424.684 1,305.133 ↑ 2.9 274,353 1

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

  • Buckets: 1048576 Batches: 1 Memory Usage: 17838kB
23. 802.241 880.449 ↑ 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=92.338..880.449 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. 78.208 78.208 ↓ 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=78.206..78.208 rows=846,814 loops=1)

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

Index Scan using omaha_request_pkey on omaha_request (cost=0.43..1.13 rows=1 width=675) (actual time=0.012..0.013 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)