explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ZAAy : Optimization for: Optimization for: Optimization for: plan #jIEy; plan #ykVf; plan #V6mw

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 391.222 175,143.627 ↑ 58,621,996,336,853.0 412,240 1

Merge Right Join (cost=1,763,196,283.37..543,744,511,528,900,416.00 rows=24,166,331,769,904,295,936 width=244) (actual time=173,513.115..175,143.627 rows=412,240 loops=1)

  • Merge Cond: (first_game_mode.epic_id = regs.epic_id)
2.          

CTE regs

3. 417.307 417.307 ↓ 1.1 402,669 1

Seq Scan on epic_auth_registrations reg (cost=0.00..37,907.58 rows=363,865 width=80) (actual time=0.023..417.307 rows=402,669 loops=1)

  • Filter: (event > (now() - '90 days'::interval))
  • Rows Removed by Filter: 1,147,116
4.          

CTE last_step

5. 484.610 484.610 ↓ 1.6 402,669 1

Seq Scan on users (cost=0.00..74,094.35 rows=244,940 width=64) (actual time=0.022..484.610 rows=402,669 loops=1)

  • Filter: (registration_timestamp > (now() - '90 days'::interval))
  • Rows Removed by Filter: 1,147,116
6.          

CTE max_match_1_players

7. 158.928 1,096.553 ↑ 8.0 93,339 1

Merge Join (cost=116,880.00..161,459.59 rows=742,891 width=40) (actual time=914.357..1,096.553 rows=93,339 loops=1)

  • Merge Cond: (users_1.epic_id = regs_1.epic_id)
  • Join Filter: ((regs_1.reg_timestamp + '168:00:00'::interval) >= users_1.last_match_timestamp)
  • Rows Removed by Join Filter: 2,781
8. 266.314 716.640 ↓ 81.0 99,273 1

Sort (cost=75,994.23..75,997.30 rows=1,225 width=40) (actual time=711.831..716.640 rows=99,273 loops=1)

  • Sort Key: users_1.epic_id
  • Sort Method: quicksort Memory: 10,828kB
9. 450.326 450.326 ↓ 81.0 99,273 1

Seq Scan on users users_1 (cost=0.00..75,931.40 rows=1,225 width=40) (actual time=0.021..450.326 rows=99,273 loops=1)

  • Filter: ((matches = 1) AND (last_match_timestamp > (now() - '90 days'::interval)))
  • Rows Removed by Filter: 1,450,512
10. 177.551 220.985 ↓ 1.1 402,669 1

Sort (cost=40,885.77..41,795.43 rows=363,865 width=40) (actual time=202.514..220.985 rows=402,669 loops=1)

  • Sort Key: regs_1.epic_id
  • Sort Method: quicksort Memory: 43,747kB
11. 43.434 43.434 ↓ 1.1 402,669 1

CTE Scan on regs regs_1 (cost=0.00..7,277.30 rows=363,865 width=40) (actual time=0.002..43.434 rows=402,669 loops=1)

12.          

CTE last_quit

13. 12.752 1,834.848 ↑ 9.7 67,258 1

Subquery Scan on foo (cost=30,547,965.29..34,783,939.11 rows=651,688 width=128) (actual time=1,725.842..1,834.848 rows=67,258 loops=1)

  • Filter: (foo.rn = 1)
  • Rows Removed by Filter: 108,555
14. 86.921 1,822.096 ↑ 741.3 175,813 1

WindowAgg (cost=30,547,965.29..33,154,718.41 rows=130,337,656 width=144) (actual time=1,725.839..1,822.096 rows=175,813 loops=1)

15. 307.684 1,735.175 ↑ 741.3 175,813 1

Sort (cost=30,547,965.29..30,873,809.43 rows=130,337,656 width=136) (actual time=1,725.195..1,735.175 rows=175,813 loops=1)

  • Sort Key: player_quit.epic_id, player_quit."timestamp" DESC
  • Sort Method: quicksort Memory: 30,868kB
16. 233.356 1,427.491 ↑ 741.3 175,813 1

Merge Join (cost=67,312.04..7,888,646.01 rows=130,337,656 width=136) (actual time=1,116.659..1,427.491 rows=175,813 loops=1)

  • Merge Cond: (player_quit.epic_id = regs_2.epic_id)
  • Join Filter: ((regs_2.reg_timestamp + '168:00:00'::interval) >= player_quit."timestamp")
  • Rows Removed by Join Filter: 77,183
17. 932.556 972.960 ↓ 1.4 305,302 1

Sort (cost=26,426.27..26,963.58 rows=214,922 width=136) (actual time=925.498..972.960 rows=305,302 loops=1)

  • Sort Key: player_quit.epic_id
  • Sort Method: quicksort Memory: 55,222kB
18. 40.404 40.404 ↓ 1.4 305,302 1

Seq Scan on player_quit (cost=0.00..7,391.22 rows=214,922 width=136) (actual time=0.012..40.404 rows=305,302 loops=1)

19. 179.539 221.175 ↓ 1.6 570,970 1

Sort (cost=40,885.77..41,795.43 rows=363,865 width=40) (actual time=191.149..221.175 rows=570,970 loops=1)

  • Sort Key: regs_2.epic_id
  • Sort Method: quicksort Memory: 43,747kB
20. 41.636 41.636 ↓ 1.1 402,669 1

CTE Scan on regs regs_2 (cost=0.00..7,277.30 rows=363,865 width=40) (actual time=0.003..41.636 rows=402,669 loops=1)

21.          

CTE customization

22. 301.987 21,648.597 ↓ 1,551.3 310,253 1

GroupAggregate (cost=685,876.33..75,672,039.50 rows=200 width=40) (actual time=18,152.894..21,648.597 rows=310,253 loops=1)

  • Group Key: char_customization_selected.epic_id
23. 917.794 21,346.610 ↑ 438.3 2,631,560 1

Merge Join (cost=685,876.33..69,904,377.00 rows=1,153,532,100 width=40) (actual time=18,152.866..21,346.610 rows=2,631,560 loops=1)

  • Merge Cond: (regs_3.epic_id = char_customization_selected.epic_id)
  • Join Filter: ((regs_3.reg_timestamp + '168:00:00'::interval) >= char_customization_selected."timestamp")
  • Rows Removed by Join Filter: 872,237
24. 168.610 211.397 ↓ 1.1 402,669 1

Sort (cost=40,885.77..41,795.43 rows=363,865 width=40) (actual time=190.421..211.397 rows=402,669 loops=1)

  • Sort Key: regs_3.epic_id
  • Sort Method: quicksort Memory: 43,747kB
25. 42.787 42.787 ↓ 1.1 402,669 1

CTE Scan on regs regs_3 (cost=0.00..7,277.30 rows=363,865 width=40) (actual time=0.004..42.787 rows=402,669 loops=1)

26. 416.291 20,217.419 ↓ 2.4 4,519,828 1

Materialize (cost=644,990.56..654,501.22 rows=1,902,132 width=40) (actual time=17,962.433..20,217.419 rows=4,519,828 loops=1)

27. 15,022.984 19,801.128 ↓ 2.4 4,519,828 1

Sort (cost=644,990.56..649,745.89 rows=1,902,132 width=40) (actual time=17,962.423..19,801.128 rows=4,519,828 loops=1)

  • Sort Key: char_customization_selected.epic_id
  • Sort Method: external merge Disk: 256,520kB
28. 4,778.144 4,778.144 ↓ 2.4 4,519,828 1

Seq Scan on char_customization_selected (cost=0.00..416,883.93 rows=1,902,132 width=40) (actual time=26.423..4,778.144 rows=4,519,828 loops=1)

  • Filter: ("timestamp" > (now() - '90 days'::interval))
  • Rows Removed by Filter: 3,251,619
29.          

CTE all_unioned

30. 382.137 155,009.899 ↑ 45.0 511,265 1

Subquery Scan on all_unioned_1 (cost=1,491,497,413.33..1,640,975,940.19 rows=22,996,696 width=64) (actual time=147,666.386..155,009.899 rows=511,265 loops=1)

  • Filter: (all_unioned_1.last_event = 1)
  • Rows Removed by Filter: 6,510,991
31. 3,942.311 154,627.762 ↑ 655.0 7,022,256 1

WindowAgg (cost=1,491,497,413.33..1,583,484,199.09 rows=4,599,339,288 width=76) (actual time=147,666.384..154,627.762 rows=7,022,256 loops=1)

32. 17,809.597 150,685.451 ↑ 655.0 7,022,256 1

Sort (cost=1,491,497,413.33..1,502,995,761.55 rows=4,599,339,288 width=68) (actual time=147,666.365..150,685.451 rows=7,022,256 loops=1)

  • Sort Key: foo_1.epic_id, foo_1.event_rank DESC
  • Sort Method: external merge Disk: 462,064kB
33. 657.719 132,875.854 ↑ 655.0 7,022,256 1

Subquery Scan on foo_1 (cost=96,322.20..537,737,493.49 rows=4,599,339,288 width=68) (actual time=752.781..132,875.854 rows=7,022,256 loops=1)

34. 490.418 132,218.135 ↑ 655.0 7,022,256 1

Append (cost=96,322.20..491,744,100.61 rows=4,599,339,288 width=68) (actual time=752.778..132,218.135 rows=7,022,256 loops=1)

35. 0.228 753.076 ↓ 3.8 1,547 1

Unique (cost=96,322.20..96,324.23 rows=405 width=69) (actual time=752.777..753.076 rows=1,547 loops=1)

36. 2.575 752.848 ↓ 3.8 1,549 1

Sort (cost=96,322.20..96,323.21 rows=405 width=69) (actual time=752.776..752.848 rows=1,549 loops=1)

  • Sort Key: epic_auth_registrations.epic_id
  • Sort Method: quicksort Memory: 266kB
37. 121.423 750.273 ↓ 3.8 1,549 1

Hash Join (cost=77,602.46..96,304.66 rows=405 width=69) (actual time=631.895..750.273 rows=1,549 loops=1)

  • Hash Cond: (client_events_pre_load_tutorial.user_id = epic_auth_registrations.user_id)
38. 0.110 0.481 ↓ 3.8 1,550 1

Append (cost=0.43..411.55 rows=405 width=37) (actual time=0.032..0.481 rows=1,550 loops=1)

39. 0.371 0.371 ↓ 3.8 1,550 1

Index Scan using client_events_pre_load_tutorial_event_timestamp_idx on client_events_pre_load_tutorial (cost=0.43..409.53 rows=405 width=37) (actual time=0.031..0.371 rows=1,550 loops=1)

  • Index Cond: ((event = 'pre_load_tutorial'::text) AND ("timestamp" > (now() - '90 days'::interval)))
40. 406.162 628.369 ↑ 1.0 1,557,359 1

Hash (cost=39,830.57..39,830.57 rows=1,559,557 width=70) (actual time=628.368..628.369 rows=1,557,359 loops=1)

  • Buckets: 1,048,576 Batches: 2 Memory Usage: 85,823kB
41. 222.207 222.207 ↑ 1.0 1,557,359 1

Seq Scan on epic_auth_registrations (cost=0.00..39,830.57 rows=1,559,557 width=70) (actual time=0.009..222.207 rows=1,557,359 loops=1)

42. 1,089.254 3,259.435 ↓ 2,498.5 499,699 1

HashAggregate (cost=344,631.00..344,633.00 rows=200 width=68) (actual time=3,144.144..3,259.435 rows=499,699 loops=1)

  • Group Key: logins_cleaned.epic_id, 'Login'::character varying, 2
43. 2,170.181 2,170.181 ↑ 1.3 2,289,658 1

Seq Scan on logins_cleaned (cost=0.00..322,065.88 rows=3,008,683 width=68) (actual time=0.036..2,170.181 rows=2,289,658 loops=1)

  • Filter: (event_login > (now() - '90 days'::interval))
  • Rows Removed by Filter: 5,798,175
44. 0.001 106.775 ↓ 0.0 0 1

Unique (cost=42,941.10..42,948.33 rows=200 width=68) (actual time=106.775..106.775 rows=0 loops=1)

45. 0.009 106.774 ↓ 0.0 0 1

Sort (cost=42,941.10..42,944.71 rows=1,446 width=68) (actual time=106.774..106.774 rows=0 loops=1)

  • Sort Key: map_loading_time_event.epic_id
  • Sort Method: quicksort Memory: 25kB
46. 106.765 106.765 ↓ 0.0 0 1

Seq Scan on map_loading_time_event (cost=0.00..42,865.20 rows=1,446 width=68) (actual time=106.765..106.765 rows=0 loops=1)

  • Filter: ((map_name = '/Game/Maps/Meta/Outpost/Outpost_P'::text) AND ("timestamp" > (now() - '90 days'::interval)))
  • Rows Removed by Filter: 964,528
47. 0.001 300.363 ↓ 0.0 0 1

Unique (cost=134,657.40..134,684.22 rows=200 width=68) (actual time=300.363..300.363 rows=0 loops=1)

48. 0.005 300.362 ↓ 0.0 0 1

Sort (cost=134,657.40..134,670.81 rows=5,364 width=68) (actual time=300.362..300.362 rows=0 loops=1)

  • Sort Key: map_loading_time_event_client.epic_id
  • Sort Method: quicksort Memory: 25kB
49. 300.357 300.357 ↓ 0.0 0 1

Seq Scan on map_loading_time_event_client (cost=0.00..134,325.12 rows=5,364 width=68) (actual time=300.357..300.357 rows=0 loops=1)

  • Filter: ((map_name = '/Game/Maps/Tutorial/Tut_Walkthrough_P'::text) AND ("timestamp" > (now() - '90 days'::interval)))
  • Rows Removed by Filter: 3,318,640
50. 21,726.294 21,726.294 ↓ 1,551.3 310,253 1

CTE Scan on customization (cost=0.00..4.00 rows=200 width=68) (actual time=18,152.897..21,726.294 rows=310,253 loops=1)

51. 38.419 630.851 ↓ 1.6 402,669 1

Subquery Scan on *SELECT* 6 (cost=0.00..7,348.20 rows=244,940 width=68) (actual time=0.025..630.851 rows=402,669 loops=1)

52. 592.432 592.432 ↓ 1.6 402,669 1

CTE Scan on last_step (cost=0.00..4,898.80 rows=244,940 width=68) (actual time=0.023..592.432 rows=402,669 loops=1)

53. 26.965 1,161.753 ↓ 401.6 80,316 1

Group (cost=84,102.11..7,144,500.30 rows=200 width=68) (actual time=873.456..1,161.753 rows=80,316 loops=1)

  • Group Key: client_disconnected.epic_id, 'Connection Timeout'::character varying, 16
54. 204.087 1,134.788 ↑ 737.7 141,777 1

Merge Join (cost=84,102.11..6,360,107.42 rows=104,585,717 width=68) (actual time=873.453..1,134.788 rows=141,777 loops=1)

  • Merge Cond: (client_disconnected.epic_id = regs_4.epic_id)
  • Join Filter: ((regs_4.reg_timestamp + '168:00:00'::interval) >= client_disconnected."timestamp")
  • Rows Removed by Join Filter: 31,393
55. 616.816 719.864 ↓ 1.2 215,073 1

Sort (cost=43,216.34..43,647.49 rows=172,458 width=40) (actual time=689.031..719.864 rows=215,073 loops=1)

  • Sort Key: client_disconnected.epic_id
  • Sort Method: quicksort Memory: 22,947kB
56. 103.048 103.048 ↓ 1.2 215,073 1

Seq Scan on client_disconnected (cost=0.00..28,216.04 rows=172,458 width=40) (actual time=5.242..103.048 rows=215,073 loops=1)

  • Filter: ("timestamp" > (now() - '90 days'::interval))
  • Rows Removed by Filter: 17,738
57. 164.825 210.837 ↓ 1.3 489,073 1

Sort (cost=40,885.77..41,795.43 rows=363,865 width=40) (actual time=184.379..210.837 rows=489,073 loops=1)

  • Sort Key: regs_4.epic_id
  • Sort Method: quicksort Memory: 43,747kB
58. 46.012 46.012 ↓ 1.1 402,669 1

CTE Scan on regs regs_4 (cost=0.00..7,277.30 rows=363,865 width=40) (actual time=0.004..46.012 rows=402,669 loops=1)

59. 4.409 444.513 ↓ 72.0 14,409 1

Group (cost=65,619.45..4,889,721.31 rows=200 width=68) (actual time=306.763..444.513 rows=14,409 loops=1)

  • Group Key: client_disconnected_client.epic_id, 'Client Disconnect'::character varying, 17
60. 110.736 440.104 ↑ 3,352.4 21,316 1

Merge Join (cost=65,619.45..4,353,775.46 rows=71,459,447 width=68) (actual time=306.761..440.104 rows=21,316 loops=1)

  • Merge Cond: (client_disconnected_client.epic_id = regs_5.epic_id)
  • Join Filter: ((regs_5.reg_timestamp + '168:00:00'::interval) >= client_disconnected_client."timestamp")
  • Rows Removed by Join Filter: 4,012
61. 68.254 117.538 ↑ 3.7 32,020 1

Sort (cost=24,733.68..25,028.26 rows=117,834 width=40) (actual time=113.687..117.538 rows=32,020 loops=1)

  • Sort Key: client_disconnected_client.epic_id
  • Sort Method: quicksort Memory: 3,270kB
62. 49.284 49.284 ↑ 3.7 32,020 1

Seq Scan on client_disconnected_client (cost=0.00..14,808.28 rows=117,834 width=40) (actual time=31.778..49.284 rows=32,020 loops=1)

  • Filter: ("timestamp" > (now() - '90 days'::interval))
  • Rows Removed by Filter: 129,426
63. 170.010 211.830 ↓ 1.1 411,611 1

Sort (cost=40,885.77..41,795.43 rows=363,865 width=40) (actual time=193.027..211.830 rows=411,611 loops=1)

  • Sort Key: regs_5.epic_id
  • Sort Method: quicksort Memory: 43,747kB
64. 41.820 41.820 ↓ 1.1 402,669 1

CTE Scan on regs regs_5 (cost=0.00..7,277.30 rows=363,865 width=40) (actual time=0.002..41.820 rows=402,669 loops=1)

65. 34.858 412.606 ↓ 12.3 374,263 1

Subquery Scan on *SELECT* 9 (cost=11,071.14..12,059.82 rows=30,421 width=68) (actual time=278.114..412.606 rows=374,263 loops=1)

66. 280.125 377.748 ↓ 12.3 374,263 1

HashAggregate (cost=11,071.14..11,451.40 rows=30,421 width=68) (actual time=278.113..377.748 rows=374,263 loops=1)

  • Group Key: last_button.epic_id, concat('Button after tutorial: ', last_button.button_name), 18
67. 97.623 97.623 ↓ 1.2 374,265 1

Seq Scan on last_button (cost=0.00..8,789.59 rows=304,207 width=68) (actual time=0.026..97.623 rows=374,265 loops=1)

68. 192.340 19,943.542 ↓ 721.9 144,370 1

Unique (cost=1,018,674.21..127,997,854.35 rows=200 width=68) (actual time=17,088.369..19,943.542 rows=144,370 loops=1)

69. 759.613 19,751.202 ↑ 803.5 2,528,424 1

Merge Join (cost=1,018,674.21..122,919,094.91 rows=2,031,503,778 width=68) (actual time=17,088.368..19,751.202 rows=2,528,424 loops=1)

  • Merge Cond: (regs_6.epic_id = blueprint_crafted.epic_id)
  • Join Filter: ((regs_6.reg_timestamp + '168:00:00'::interval) >= blueprint_crafted.event)
  • Rows Removed by Join Filter: 486,931
70. 159.400 201.688 ↓ 1.1 402,668 1

Sort (cost=40,885.77..41,795.43 rows=363,865 width=40) (actual time=181.798..201.688 rows=402,668 loops=1)

  • Sort Key: regs_6.epic_id
  • Sort Method: quicksort Memory: 43,747kB
71. 42.288 42.288 ↓ 1.1 402,669 1

CTE Scan on regs regs_6 (cost=0.00..7,277.30 rows=363,865 width=40) (actual time=0.002..42.288 rows=402,669 loops=1)

72. 334.730 18,789.901 ↓ 1.1 3,714,214 1

Materialize (cost=977,788.44..994,537.82 rows=3,349,875 width=40) (actual time=16,906.532..18,789.901 rows=3,714,214 loops=1)

73. 11,813.429 18,455.171 ↓ 1.1 3,714,214 1

Sort (cost=977,788.44..986,163.13 rows=3,349,875 width=40) (actual time=16,906.527..18,455.171 rows=3,714,214 loops=1)

  • Sort Key: blueprint_crafted.epic_id
  • Sort Method: external merge Disk: 210,800kB
74. 6,641.742 6,641.742 ↓ 1.1 3,714,214 1

Seq Scan on blueprint_crafted (cost=0.00..562,392.42 rows=3,349,875 width=40) (actual time=4,778.622..6,641.742 rows=3,714,214 loops=1)

  • Filter: (event > (now() - '90 days'::interval))
  • Rows Removed by Filter: 10,942,116
75. 1,024.117 24,412.900 ↑ 1,150.4 2,967,599 1

Merge Join (cost=1,346,717.23..206,191,933.43 rows=3,413,822,062 width=68) (actual time=20,808.320..24,412.900 rows=2,967,599 loops=1)

  • Merge Cond: (regs_7.epic_id = matchmaking_started.epic_id)
  • Join Filter: ((regs_7.reg_timestamp + '168:00:00'::interval) >= matchmaking_started.event)
  • Rows Removed by Join Filter: 874,267
76. 155.273 197.340 ↓ 1.1 402,669 1

Sort (cost=40,885.77..41,795.43 rows=363,865 width=40) (actual time=175.740..197.340 rows=402,669 loops=1)

  • Sort Key: regs_7.epic_id
  • Sort Method: quicksort Memory: 43,747kB
77. 42.067 42.067 ↓ 1.1 402,669 1

CTE Scan on regs regs_7 (cost=0.00..7,277.30 rows=363,865 width=40) (actual time=0.003..42.067 rows=402,669 loops=1)

78. 455.807 23,191.443 ↑ 1.1 4,968,025 1

Materialize (cost=1,305,831.46..1,333,977.80 rows=5,629,267 width=40) (actual time=20,632.568..23,191.443 rows=4,968,025 loops=1)

79. 16,835.672 22,735.636 ↑ 1.1 4,968,025 1

Sort (cost=1,305,831.46..1,319,904.63 rows=5,629,267 width=40) (actual time=20,632.562..22,735.636 rows=4,968,025 loops=1)

  • Sort Key: matchmaking_started.epic_id
  • Sort Method: external merge Disk: 281,952kB
80. 5,899.964 5,899.964 ↑ 1.1 4,968,025 1

Seq Scan on matchmaking_started (cost=0.00..586,705.54 rows=5,629,267 width=40) (actual time=4,058.081..5,899.964 rows=4,968,025 loops=1)

  • Filter: (event > (now() - '90 days'::interval))
  • Rows Removed by Filter: 13,683,135
81. 415.641 4,793.792 ↑ 1,158.2 621,876 1

Merge Join (cost=287,850.67..43,504,169.50 rows=720,241,658 width=68) (actual time=4,202.632..4,793.792 rows=621,876 loops=1)

  • Merge Cond: (regs_8.epic_id = matchmaking_cancelled.epic_id)
  • Join Filter: ((regs_8.reg_timestamp + '168:00:00'::interval) >= matchmaking_cancelled.event)
  • Rows Removed by Join Filter: 164,563
82. 161.300 203.310 ↓ 1.1 402,668 1

Sort (cost=40,885.77..41,795.43 rows=363,865 width=40) (actual time=175.309..203.310 rows=402,668 loops=1)

  • Sort Key: regs_8.epic_id
  • Sort Method: quicksort Memory: 43,747kB
83. 42.010 42.010 ↓ 1.1 402,669 1

CTE Scan on regs regs_8 (cost=0.00..7,277.30 rows=363,865 width=40) (actual time=0.003..42.010 rows=402,669 loops=1)

84. 3,307.272 4,174.841 ↑ 1.2 992,970 1

Sort (cost=246,964.90..249,934.03 rows=1,187,652 width=40) (actual time=4,027.309..4,174.841 rows=992,970 loops=1)

  • Sort Key: matchmaking_cancelled.epic_id
  • Sort Method: quicksort Memory: 101,774kB
85. 867.569 867.569 ↑ 1.2 992,970 1

Seq Scan on matchmaking_cancelled (cost=0.00..127,132.71 rows=1,187,652 width=40) (actual time=587.097..867.569 rows=992,970 loops=1)

  • Filter: (event > (now() - '90 days'::interval))
  • Rows Removed by Filter: 2,906,860
86. 320.937 6,708.825 ↑ 36.8 312,868 1

Merge Join (cost=596,237.96..1,288,040.37 rows=11,528,456 width=68) (actual time=6,348.050..6,708.825 rows=312,868 loops=1)

  • Merge Cond: (player_matched.epic_id = regs_9.epic_id)
  • Join Filter: ((regs_9.reg_timestamp + '168:00:00'::interval) >= player_matched.event)
  • Rows Removed by Join Filter: 4,934
87. 1,053.189 6,157.892 ↓ 17.1 325,044 1

Sort (cost=555,352.19..555,399.71 rows=19,010 width=40) (actual time=6,139.950..6,157.892 rows=325,044 loops=1)

  • Sort Key: player_matched.epic_id
  • Sort Method: quicksort Memory: 37,683kB
88. 5,104.703 5,104.703 ↓ 17.1 325,044 1

Seq Scan on player_matched (cost=0.00..554,001.10 rows=19,010 width=40) (actual time=0.660..5,104.703 rows=325,044 loops=1)

  • Filter: ((battle_matched_num = 1) AND (event > (now() - '90 days'::interval)))
  • Rows Removed by Filter: 14,439,397
89. 188.814 229.996 ↓ 1.1 402,669 1

Sort (cost=40,885.77..41,795.43 rows=363,865 width=40) (actual time=208.088..229.996 rows=402,669 loops=1)

  • Sort Key: regs_9.epic_id
  • Sort Method: quicksort Memory: 43,747kB
90. 41.182 41.182 ↓ 1.1 402,669 1

CTE Scan on regs regs_9 (cost=0.00..7,277.30 rows=363,865 width=40) (actual time=0.002..41.182 rows=402,669 loops=1)

91. 277.938 10,154.013 ↑ 37.9 311,944 1

Merge Join (cost=807,593.92..1,516,755.08 rows=11,817,729 width=68) (actual time=9,841.113..10,154.013 rows=311,944 loops=1)

  • Merge Cond: (match_summary.epic_id = regs_10.epic_id)
  • Join Filter: ((regs_10.reg_timestamp + '168:00:00'::interval) >= match_summary."timestamp")
  • Rows Removed by Join Filter: 5,032
92. 1,037.099 9,663.842 ↓ 16.7 324,618 1

Sort (cost=766,708.15..766,756.87 rows=19,487 width=40) (actual time=9,648.497..9,663.842 rows=324,618 loops=1)

  • Sort Key: match_summary.epic_id
  • Sort Method: quicksort Memory: 37,649kB
93. 8,626.743 8,626.743 ↓ 16.7 324,618 1

Seq Scan on match_summary (cost=0.00..765,319.68 rows=19,487 width=40) (actual time=1.026..8,626.743 rows=324,618 loops=1)

  • Filter: ((battle_num = 1) AND ("timestamp" > (now() - '90 days'::interval)))
  • Rows Removed by Filter: 13,892,421
94. 170.274 212.233 ↓ 1.1 404,492 1

Sort (cost=40,885.77..41,795.43 rows=363,865 width=40) (actual time=192.605..212.233 rows=404,492 loops=1)

  • Sort Key: regs_10.epic_id
  • Sort Method: quicksort Memory: 43,747kB
95. 41.959 41.959 ↓ 1.1 402,669 1

CTE Scan on regs regs_10 (cost=0.00..7,277.30 rows=363,865 width=40) (actual time=0.002..41.959 rows=402,669 loops=1)

96. 251.852 6,249.427 ↑ 22.1 267,940 1

Merge Join (cost=806,851.00..1,161,449.78 rows=5,909,168 width=68) (actual time=5,964.725..6,249.427 rows=267,940 loops=1)

  • Merge Cond: (match_summary_1.epic_id = regs_11.epic_id)
  • Join Filter: ((regs_11.reg_timestamp + '168:00:00'::interval) >= match_summary_1."timestamp")
  • Rows Removed by Join Filter: 3,898
97. 868.840 5,784.257 ↓ 28.5 278,144 1

Sort (cost=765,965.23..765,989.59 rows=9,744 width=40) (actual time=5,770.723..5,784.257 rows=278,144 loops=1)

  • Sort Key: match_summary_1.epic_id
  • Sort Method: quicksort Memory: 34,019kB
98. 4,915.417 4,915.417 ↓ 28.5 278,144 1

Seq Scan on match_summary match_summary_1 (cost=0.00..765,319.68 rows=9,744 width=40) (actual time=0.071..4,915.417 rows=278,144 loops=1)

  • Filter: ((NOT match_left) AND (battle_num = 1) AND ("timestamp" > (now() - '90 days'::interval)))
  • Rows Removed by Filter: 13,938,895
99. 170.020 213.318 ↓ 1.1 404,128 1

Sort (cost=40,885.77..41,795.43 rows=363,865 width=40) (actual time=193.990..213.318 rows=404,128 loops=1)

  • Sort Key: regs_11.epic_id
  • Sort Method: quicksort Memory: 43,747kB
100. 43.298 43.298 ↓ 1.1 402,669 1

CTE Scan on regs regs_11 (cost=0.00..7,277.30 rows=363,865 width=40) (actual time=0.004..43.298 rows=402,669 loops=1)

101. 176.305 2,819.186 ↑ 25,343.5 14,862 1

Merge Join (cost=123,034.32..20,840,547.57 rows=376,654,404 width=68) (actual time=2,578.501..2,819.186 rows=14,862 loops=1)

  • Merge Cond: (last_button_1.epic_id = max_match_1_players.epic_id)
  • Join Filter: (last_button_1."timestamp" > max_match_1_players.match_start_time)
  • Rows Removed by Join Filter: 78,381
102. 1,445.829 1,489.934 ↓ 1.2 374,265 1

Sort (cost=35,734.26..36,494.77 rows=304,207 width=72) (actual time=1,432.721..1,489.934 rows=374,265 loops=1)

  • Sort Key: last_button_1.epic_id
  • Sort Method: quicksort Memory: 60,134kB
103. 44.105 44.105 ↓ 1.2 374,265 1

Seq Scan on last_button last_button_1 (cost=0.00..8,029.07 rows=304,207 width=72) (actual time=0.014..44.105 rows=374,265 loops=1)

104. 36.979 1,152.947 ↑ 8.0 93,340 1

Sort (cost=87,300.06..89,157.29 rows=742,891 width=40) (actual time=1,145.753..1,152.947 rows=93,340 loops=1)

  • Sort Key: max_match_1_players.epic_id
  • Sort Method: quicksort Memory: 10,365kB
105. 1,115.968 1,115.968 ↑ 8.0 93,339 1

CTE Scan on max_match_1_players (cost=0.00..14,857.82 rows=742,891 width=40) (actual time=914.360..1,115.968 rows=93,339 loops=1)

106. 234.195 5,891.760 ↑ 55.5 213,078 1

Merge Join (cost=807,593.92..1,516,755.08 rows=11,817,729 width=68) (actual time=5,627.365..5,891.760 rows=213,078 loops=1)

  • Merge Cond: (match_summary_2.epic_id = regs_12.epic_id)
  • Join Filter: ((regs_12.reg_timestamp + '168:00:00'::interval) >= match_summary_2."timestamp")
  • Rows Removed by Join Filter: 7,265
107. 705.164 5,440.292 ↓ 11.9 232,241 1

Sort (cost=766,708.15..766,756.87 rows=19,487 width=40) (actual time=5,428.977..5,440.292 rows=232,241 loops=1)

  • Sort Key: match_summary_2.epic_id
  • Sort Method: quicksort Memory: 24,288kB
108. 4,735.128 4,735.128 ↓ 11.9 232,241 1

Seq Scan on match_summary match_summary_2 (cost=0.00..765,319.68 rows=19,487 width=40) (actual time=0.050..4,735.128 rows=232,241 loops=1)

  • Filter: ((battle_num = 2) AND ("timestamp" > (now() - '90 days'::interval)))
  • Rows Removed by Filter: 13,984,798
109. 173.285 217.273 ↓ 1.1 403,979 1

Sort (cost=40,885.77..41,795.43 rows=363,865 width=40) (actual time=198.374..217.273 rows=403,979 loops=1)

  • Sort Key: regs_12.epic_id
  • Sort Method: quicksort Memory: 43,747kB
110. 43.988 43.988 ↓ 1.1 402,669 1

CTE Scan on regs regs_12 (cost=0.00..7,277.30 rows=363,865 width=40) (actual time=0.002..43.988 rows=402,669 loops=1)

111. 242.757 5,712.887 ↑ 71.7 164,729 1

Merge Join (cost=807,593.92..1,516,755.08 rows=11,817,729 width=68) (actual time=5,436.541..5,712.887 rows=164,729 loops=1)

  • Merge Cond: (match_summary_3.epic_id = regs_13.epic_id)
  • Join Filter: ((regs_13.reg_timestamp + '168:00:00'::interval) >= match_summary_3."timestamp")
  • Rows Removed by Join Filter: 7,473
112. 552.303 5,266.861 ↓ 9.5 185,195 1

Sort (cost=766,708.15..766,756.87 rows=19,487 width=40) (actual time=5,255.527..5,266.861 rows=185,195 loops=1)

  • Sort Key: match_summary_3.epic_id
  • Sort Method: quicksort Memory: 20,613kB
113. 4,714.558 4,714.558 ↓ 9.5 185,195 1

Seq Scan on match_summary match_summary_3 (cost=0.00..765,319.68 rows=19,487 width=40) (actual time=0.057..4,714.558 rows=185,195 loops=1)

  • Filter: ((battle_num = 3) AND ("timestamp" > (now() - '90 days'::interval)))
  • Rows Removed by Filter: 14,031,844
114. 161.507 203.269 ↓ 1.1 403,680 1

Sort (cost=40,885.77..41,795.43 rows=363,865 width=40) (actual time=180.999..203.269 rows=403,680 loops=1)

  • Sort Key: regs_13.epic_id
  • Sort Method: quicksort Memory: 43,747kB
115. 41.762 41.762 ↓ 1.1 402,669 1

CTE Scan on regs regs_13 (cost=0.00..7,277.30 rows=363,865 width=40) (actual time=0.003..41.762 rows=402,669 loops=1)

116. 189.147 5,565.190 ↑ 86.7 136,273 1

Merge Join (cost=807,593.92..1,516,755.08 rows=11,817,729 width=68) (actual time=5,350.185..5,565.190 rows=136,273 loops=1)

  • Merge Cond: (match_summary_4.epic_id = regs_14.epic_id)
  • Join Filter: ((regs_14.reg_timestamp + '168:00:00'::interval) >= match_summary_4."timestamp")
  • Rows Removed by Join Filter: 7,395
117. 485.162 5,158.909 ↓ 8.0 156,775 1

Sort (cost=766,708.15..766,756.87 rows=19,487 width=40) (actual time=5,151.416..5,158.909 rows=156,775 loops=1)

  • Sort Key: match_summary_4.epic_id
  • Sort Method: quicksort Memory: 18,393kB
118. 4,673.747 4,673.747 ↓ 8.0 156,775 1

Seq Scan on match_summary match_summary_4 (cost=0.00..765,319.68 rows=19,487 width=40) (actual time=0.056..4,673.747 rows=156,775 loops=1)

  • Filter: ((battle_num = 4) AND ("timestamp" > (now() - '90 days'::interval)))
  • Rows Removed by Filter: 14,060,264
119. 174.184 217.134 ↓ 1.1 403,488 1

Sort (cost=40,885.77..41,795.43 rows=363,865 width=40) (actual time=198.757..217.134 rows=403,488 loops=1)

  • Sort Key: regs_14.epic_id
  • Sort Method: quicksort Memory: 43,747kB
120. 42.950 42.950 ↓ 1.1 402,669 1

CTE Scan on regs regs_14 (cost=0.00..7,277.30 rows=363,865 width=40) (actual time=0.004..42.950 rows=402,669 loops=1)

121. 179.950 5,446.135 ↑ 101.3 116,710 1

Merge Join (cost=807,593.92..1,516,755.08 rows=11,817,729 width=68) (actual time=5,239.463..5,446.135 rows=116,710 loops=1)

  • Merge Cond: (match_summary_5.epic_id = regs_15.epic_id)
  • Join Filter: ((regs_15.reg_timestamp + '168:00:00'::interval) >= match_summary_5."timestamp")
  • Rows Removed by Join Filter: 7,339
122. 401.688 5,048.212 ↓ 7.0 137,030 1

Sort (cost=766,708.15..766,756.87 rows=19,487 width=40) (actual time=5,041.373..5,048.212 rows=137,030 loops=1)

  • Sort Key: match_summary_5.epic_id
  • Sort Method: quicksort Memory: 16,850kB
123. 4,646.524 4,646.524 ↓ 7.0 137,030 1

Seq Scan on match_summary match_summary_5 (cost=0.00..765,319.68 rows=19,487 width=40) (actual time=0.055..4,646.524 rows=137,030 loops=1)

  • Filter: ((battle_num = 5) AND ("timestamp" > (now() - '90 days'::interval)))
  • Rows Removed by Filter: 14,080,009
124. 174.736 217.973 ↓ 1.1 403,403 1

Sort (cost=40,885.77..41,795.43 rows=363,865 width=40) (actual time=198.075..217.973 rows=403,403 loops=1)

  • Sort Key: regs_15.epic_id
  • Sort Method: quicksort Memory: 43,747kB
125. 43.237 43.237 ↓ 1.1 402,669 1

CTE Scan on regs regs_15 (cost=0.00..7,277.30 rows=363,865 width=40) (actual time=0.003..43.237 rows=402,669 loops=1)

126. 155.610 5,234.394 ↑ 176.8 66,851 1

Merge Join (cost=807,593.92..1,516,755.08 rows=11,817,729 width=68) (actual time=5,055.437..5,234.394 rows=66,851 loops=1)

  • Merge Cond: (match_summary_6.epic_id = regs_16.epic_id)
  • Join Filter: ((regs_16.reg_timestamp + '168:00:00'::interval) >= match_summary_6."timestamp")
  • Rows Removed by Join Filter: 6,858
127. 235.691 4,885.781 ↓ 4.4 85,379 1

Sort (cost=766,708.15..766,756.87 rows=19,487 width=40) (actual time=4,881.343..4,885.781 rows=85,379 loops=1)

  • Sort Key: match_summary_6.epic_id
  • Sort Method: quicksort Memory: 9,743kB
128. 4,650.090 4,650.090 ↓ 4.4 85,379 1

Seq Scan on match_summary match_summary_6 (cost=0.00..765,319.68 rows=19,487 width=40) (actual time=0.064..4,650.090 rows=85,379 loops=1)

  • Filter: ((battle_num = 10) AND ("timestamp" > (now() - '90 days'::interval)))
  • Rows Removed by Filter: 14,131,660
129. 150.519 193.003 ↓ 1.1 403,056 1

Sort (cost=40,885.77..41,795.43 rows=363,865 width=40) (actual time=174.080..193.003 rows=403,056 loops=1)

  • Sort Key: regs_16.epic_id
  • Sort Method: quicksort Memory: 43,747kB
130. 42.484 42.484 ↓ 1.1 402,669 1

CTE Scan on regs regs_16 (cost=0.00..7,277.30 rows=363,865 width=40) (actual time=0.003..42.484 rows=402,669 loops=1)

131.          

CTE logins

132. 1,264.621 3,897.577 ↓ 2,498.5 499,699 1

HashAggregate (cost=352,152.71..352,154.71 rows=200 width=40) (actual time=3,749.477..3,897.577 rows=499,699 loops=1)

  • Group Key: logins_cleaned_1.epic_id
133. 2,632.956 2,632.956 ↑ 1.3 2,289,658 1

Seq Scan on logins_cleaned logins_cleaned_1 (cost=0.00..322,065.88 rows=3,008,683 width=48) (actual time=0.772..2,632.956 rows=2,289,658 loops=1)

  • Filter: (event_login > (now() - '90 days'::interval))
  • Rows Removed by Filter: 5,798,175
134.          

CTE first_game_mode

135. 263.431 9,982.638 ↑ 111.8 316,976 1

Merge Join (cost=807,593.92..1,339,489.15 rows=35,453,186 width=64) (actual time=9,684.659..9,982.638 rows=316,976 loops=1)

  • Merge Cond: (match_summary_7.epic_id = regs_17.epic_id)
136. 1,061.782 8,996.366 ↓ 16.7 324,618 1

Sort (cost=766,708.15..766,756.87 rows=19,487 width=64) (actual time=8,980.480..8,996.366 rows=324,618 loops=1)

  • Sort Key: match_summary_7.epic_id
  • Sort Method: quicksort Memory: 37,649kB
137. 7,934.584 7,934.584 ↓ 16.7 324,618 1

Seq Scan on match_summary match_summary_7 (cost=0.00..765,319.68 rows=19,487 width=64) (actual time=0.919..7,934.584 rows=324,618 loops=1)

  • Filter: ((battle_num = 1) AND ("timestamp" > (now() - '90 days'::interval)))
  • Rows Removed by Filter: 13,892,421
138. 170.654 722.841 ↓ 1.1 404,492 1

Sort (cost=40,885.77..41,795.43 rows=363,865 width=32) (actual time=704.170..722.841 rows=404,492 loops=1)

  • Sort Key: regs_17.epic_id
  • Sort Method: quicksort Memory: 43,747kB
139. 552.187 552.187 ↓ 1.1 402,669 1

CTE Scan on regs regs_17 (cost=0.00..7,277.30 rows=363,865 width=32) (actual time=0.026..552.187 rows=402,669 loops=1)

140. 152.017 10,223.011 ↑ 111.8 316,976 1

Sort (cost=5,916,479.00..6,005,111.97 rows=35,453,186 width=64) (actual time=10,199.138..10,223.011 rows=316,976 loops=1)

  • Sort Key: first_game_mode.epic_id
  • Sort Method: quicksort Memory: 37,052kB
141. 10,070.994 10,070.994 ↑ 111.8 316,976 1

CTE Scan on first_game_mode (cost=0.00..709,063.72 rows=35,453,186 width=64) (actual time=9,684.663..10,070.994 rows=316,976 loops=1)

142. 79.761 164,529.394 ↑ 330,700,864.7 412,240 1

Materialize (cost=3,882,780.20..2,385,766,874,186.66 rows=136,328,124,473,238 width=208) (actual time=163,313.963..164,529.394 rows=412,240 loops=1)

143. 357.730 164,449.633 ↑ 332,393,309.8 410,141 1

Merge Left Join (cost=3,882,780.20..2,044,946,563,003.57 rows=136,328,124,473,238 width=208) (actual time=163,313.957..164,449.633 rows=410,141 loops=1)

  • Merge Cond: (regs.epic_id = all_unioned.epic_id)
144. 167.617 8,663.965 ↑ 2,959.4 400,639 1

Merge Left Join (cost=116,864.10..17,907,716.81 rows=1,185,632,271 width=176) (actual time=7,982.341..8,663.965 rows=400,639 loops=1)

  • Merge Cond: (regs.epic_id = last_quit.epic_id)
145. 386.477 6,601.930 ↓ 1.1 400,639 1

Merge Join (cost=40,897.41..46,356.39 rows=363,865 width=80) (actual time=6,094.229..6,601.930 rows=400,639 loops=1)

  • Merge Cond: (logins.epic_id = regs.epic_id)
146. 1,957.732 5,969.890 ↓ 2,498.5 499,699 1

Sort (cost=11.64..12.14 rows=200 width=40) (actual time=5,882.008..5,969.890 rows=499,699 loops=1)

  • Sort Key: logins.epic_id
  • Sort Method: quicksort Memory: 51,327kB
147. 4,012.158 4,012.158 ↓ 2,498.5 499,699 1

CTE Scan on logins (cost=0.00..4.00 rows=200 width=40) (actual time=3,749.481..4,012.158 rows=499,699 loops=1)

148. 200.902 245.563 ↓ 1.1 402,669 1

Sort (cost=40,885.77..41,795.43 rows=363,865 width=72) (actual time=212.211..245.563 rows=402,669 loops=1)

  • Sort Key: regs.epic_id
  • Sort Method: quicksort Memory: 68,914kB
149. 44.661 44.661 ↓ 1.1 402,669 1

CTE Scan on regs (cost=0.00..7,277.30 rows=363,865 width=72) (actual time=0.003..44.661 rows=402,669 loops=1)

150. 35.186 1,894.418 ↑ 9.7 67,258 1

Sort (cost=75,966.69..77,595.91 rows=651,688 width=128) (actual time=1,888.105..1,894.418 rows=67,258 loops=1)

  • Sort Key: last_quit.epic_id
  • Sort Method: quicksort Memory: 12,531kB
151. 1,859.232 1,859.232 ↑ 9.7 67,258 1

CTE Scan on last_quit (cost=0.00..13,033.76 rows=651,688 width=128) (actual time=1,725.846..1,859.232 rows=67,258 loops=1)

152. 60.666 155,427.938 ↑ 45.0 511,265 1

Materialize (cost=3,765,916.10..3,880,899.58 rows=22,996,696 width=64) (actual time=155,331.607..155,427.938 rows=511,265 loops=1)

153. 229.736 155,367.272 ↑ 45.0 511,265 1

Sort (cost=3,765,916.10..3,823,407.84 rows=22,996,696 width=64) (actual time=155,331.603..155,367.272 rows=511,265 loops=1)

  • Sort Key: all_unioned.epic_id
  • Sort Method: quicksort Memory: 76,818kB
154. 155,137.536 155,137.536 ↑ 45.0 511,265 1

CTE Scan on all_unioned (cost=0.00..459,933.92 rows=22,996,696 width=64) (actual time=147,666.389..155,137.536 rows=511,265 loops=1)

Planning time : 4.723 ms
Execution time : 175,265.524 ms