explain.depesz.com

PostgreSQL's explain analyze made readable

Result: OaHF

Settings
# exclusive inclusive rows x rows loops node
1. 0.321 1,205.544 ↑ 50.0 29 1

Hash Right Join (cost=62,126.53..62,457.60 rows=1,450 width=1,189) (actual time=1,205.248..1,205.544 rows=29 loops=1)

  • Hash Cond: (cs_7.id = cs.id)
2. 0.020 0.047 ↑ 50.0 29 1

Hash Right Join (cost=1.65..30.04 rows=1,450 width=20) (actual time=0.038..0.047 rows=29 loops=1)

  • Hash Cond: (reports.campaign_id = cs_7.id)
3. 0.003 0.003 ↓ 0.0 0 1

Seq Scan on campaigns_sentiment_reports reports (cost=0.00..24.50 rows=1,450 width=20) (actual time=0.003..0.003 rows=0 loops=1)

4. 0.009 0.024 ↑ 1.0 29 1

Hash (cost=1.29..1.29 rows=29 width=4) (actual time=0.024..0.024 rows=29 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
5. 0.015 0.015 ↑ 1.0 29 1

Seq Scan on campaigns cs_7 (cost=0.00..1.29 rows=29 width=4) (actual time=0.011..0.015 rows=29 loops=1)

6. 0.073 1,205.176 ↑ 1.0 29 1

Hash (cost=62,124.51..62,124.51 rows=29 width=1,413) (actual time=1,205.176..1,205.176 rows=29 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 16kB
7. 0.036 1,205.103 ↑ 1.0 29 1

Merge Left Join (cost=62,062.82..62,124.51 rows=29 width=1,413) (actual time=1,203.611..1,205.103 rows=29 loops=1)

  • Merge Cond: (cs.id = cs_17.id)
8. 0.031 1,204.417 ↑ 1.0 29 1

Merge Left Join (cost=62,040.73..62,101.56 rows=29 width=1,333) (actual time=1,202.969..1,204.417 rows=29 loops=1)

  • Merge Cond: (cs.id = (COALESCE(g_ads_video_ov.campaign_id, COALESCE(campaigns_10.id, boosted.campaign_id))))
9. 0.050 834.429 ↑ 1.0 29 1

Merge Left Join (cost=37,343.28..37,401.65 rows=29 width=1,189) (actual time=833.101..834.429 rows=29 loops=1)

  • Merge Cond: (cs.id = campaigns_8.id)
10. 0.069 539.586 ↑ 1.0 29 1

Merge Left Join (cost=21,634.51..21,676.28 rows=29 width=1,073) (actual time=538.564..539.586 rows=29 loops=1)

  • Merge Cond: (cs.id = cs_4.id)
11. 0.042 0.848 ↑ 1.0 29 1

Sort (cost=31.99..32.07 rows=29 width=601) (actual time=0.840..0.848 rows=29 loops=1)

  • Sort Key: cs.id
  • Sort Method: quicksort Memory: 27kB
12. 0.021 0.806 ↑ 1.0 29 1

Hash Left Join (cost=29.36..31.29 rows=29 width=601) (actual time=0.770..0.806 rows=29 loops=1)

  • Hash Cond: (cs_6.id = eps_1.campaign_id)
13. 0.040 0.294 ↑ 1.0 29 1

Hash Left Join (cost=8.67..10.23 rows=29 width=605) (actual time=0.263..0.294 rows=29 loops=1)

  • Hash Cond: (cs.id = cs_6.id)
14. 0.033 0.230 ↑ 1.0 29 1

Hash Left Join (cost=7.02..8.49 rows=29 width=601) (actual time=0.214..0.230 rows=29 loops=1)

  • Hash Cond: (cs.id = aggregated.campaign_id)
15. 0.020 0.020 ↑ 1.0 29 1

Seq Scan on campaigns cs (cost=0.00..1.29 rows=29 width=525) (actual time=0.016..0.020 rows=29 loops=1)

16. 0.005 0.177 ↑ 3.5 2 1

Hash (cost=6.93..6.93 rows=7 width=80) (actual time=0.177..0.177 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
17. 0.018 0.172 ↑ 3.5 2 1

Hash Join (cost=5.55..6.93 rows=7 width=80) (actual time=0.169..0.172 rows=2 loops=1)

  • Hash Cond: (cs_1.id = aggregated.campaign_id)
18. 0.005 0.005 ↑ 1.0 29 1

Seq Scan on campaigns cs_1 (cost=0.00..1.29 rows=29 width=4) (actual time=0.004..0.005 rows=29 loops=1)

19. 0.003 0.149 ↑ 3.5 2 1

Hash (cost=5.46..5.46 rows=7 width=80) (actual time=0.149..0.149 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
20. 0.005 0.146 ↑ 3.5 2 1

Subquery Scan on aggregated (cost=5.32..5.46 rows=7 width=80) (actual time=0.142..0.146 rows=2 loops=1)

21. 0.016 0.141 ↑ 3.5 2 1

HashAggregate (cost=5.32..5.39 rows=7 width=88) (actual time=0.141..0.141 rows=2 loops=1)

  • Group Key: campaigns_1.id
22. 0.014 0.125 ↑ 1.0 7 1

Hash Left Join (cost=3.63..5.13 rows=7 width=44) (actual time=0.114..0.125 rows=7 loops=1)

  • Hash Cond: (ext_c.id = reports2.ext_campaign_id)
23. 0.024 0.057 ↑ 1.0 7 1

Hash Right Join (cost=1.16..2.63 rows=7 width=8) (actual time=0.048..0.057 rows=7 loops=1)

  • Hash Cond: (campaigns_1.id = ext_c.campaign_id)
24. 0.019 0.019 ↑ 1.0 29 1

Seq Scan on campaigns campaigns_1 (cost=0.00..1.29 rows=29 width=4) (actual time=0.016..0.019 rows=29 loops=1)

25. 0.007 0.014 ↑ 1.0 7 1

Hash (cost=1.07..1.07 rows=7 width=8) (actual time=0.014..0.014 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
26. 0.007 0.007 ↑ 1.0 7 1

Seq Scan on external_campaigns ext_c (cost=0.00..1.07 rows=7 width=8) (actual time=0.006..0.007 rows=7 loops=1)

27. 0.011 0.054 ↓ 7.0 7 1

Hash (cost=2.46..2.46 rows=1 width=44) (actual time=0.054..0.054 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
28. 0.018 0.043 ↓ 7.0 7 1

Hash Join (cost=1.35..2.46 rows=1 width=44) (actual time=0.039..0.043 rows=7 loops=1)

  • Hash Cond: ((reports2.ext_campaign_id = reports_1.ext_campaign_id) AND (reports2.reported_at = (max(reports_1.reported_at))))
29. 0.005 0.005 ↑ 1.0 7 1

Seq Scan on external_campaigns_reports reports2 (cost=0.00..1.07 rows=7 width=52) (actual time=0.005..0.005 rows=7 loops=1)

30. 0.008 0.020 ↑ 1.0 7 1

Hash (cost=1.25..1.25 rows=7 width=12) (actual time=0.020..0.020 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
31. 0.010 0.012 ↑ 1.0 7 1

HashAggregate (cost=1.11..1.18 rows=7 width=12) (actual time=0.011..0.012 rows=7 loops=1)

  • Group Key: reports_1.ext_campaign_id
32. 0.002 0.002 ↑ 1.0 7 1

Seq Scan on external_campaigns_reports reports_1 (cost=0.00..1.07 rows=7 width=12) (actual time=0.002..0.002 rows=7 loops=1)

33. 0.011 0.024 ↑ 1.0 29 1

Hash (cost=1.29..1.29 rows=29 width=4) (actual time=0.024..0.024 rows=29 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
34. 0.013 0.013 ↑ 1.0 29 1

Seq Scan on campaigns cs_6 (cost=0.00..1.29 rows=29 width=4) (actual time=0.010..0.013 rows=29 loops=1)

35. 0.007 0.491 ↑ 4.3 6 1

Hash (cost=20.37..20.37 rows=26 width=4) (actual time=0.491..0.491 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
36. 0.001 0.484 ↑ 4.3 6 1

Subquery Scan on eps_1 (cost=19.85..20.37 rows=26 width=4) (actual time=0.482..0.484 rows=6 loops=1)

37. 0.017 0.483 ↑ 4.3 6 1

HashAggregate (cost=19.85..20.11 rows=26 width=120) (actual time=0.481..0.483 rows=6 loops=1)

  • Group Key: cs_8.id, ext_posts.platform
38. 0.042 0.466 ↑ 1.0 26 1

Hash Right Join (cost=15.74..19.72 rows=26 width=8) (actual time=0.346..0.466 rows=26 loops=1)

  • Hash Cond: (links.url = ext_posts.url)
39. 0.037 0.290 ↑ 1.0 73 1

Hash Left Join (cost=8.13..11.57 rows=73 width=53) (actual time=0.199..0.290 rows=73 loops=1)

  • Hash Cond: (creatives_1.campaign_id = campaigns_2.id)
40. 0.035 0.233 ↑ 1.0 73 1

Hash Left Join (cost=6.48..9.70 rows=73 width=65) (actual time=0.166..0.233 rows=73 loops=1)

  • Hash Cond: (links.creative_id = creatives_1.id)
41. 0.048 0.159 ↑ 1.0 73 1

Hash Left Join (cost=3.90..6.92 rows=73 width=65) (actual time=0.116..0.159 rows=73 loops=1)

  • Hash Cond: (links.url = reports3.ext_post_url)
42. 0.011 0.011 ↑ 1.0 73 1

Seq Scan on campaign_social_links links (cost=0.00..2.73 rows=73 width=65) (actual time=0.005..0.011 rows=73 loops=1)

43. 0.007 0.100 ↓ 21.0 21 1

Hash (cost=3.89..3.89 rows=1 width=32) (actual time=0.100..0.100 rows=21 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
44. 0.035 0.093 ↓ 21.0 21 1

Hash Join (cost=2.45..3.89 rows=1 width=32) (actual time=0.072..0.093 rows=21 loops=1)

  • Hash Cond: ((reports3.reported_at = wlatest.latest_report) AND (reports3.ext_post_url = wlatest.ext_post_url))
45. 0.008 0.008 ↑ 1.0 29 1

Seq Scan on ext_posts_reports reports3 (cost=0.00..1.29 rows=29 width=40) (actual time=0.005..0.008 rows=29 loops=1)

46. 0.013 0.050 ↑ 1.4 21 1

Hash (cost=2.02..2.02 rows=29 width=40) (actual time=0.050..0.050 rows=21 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
47. 0.005 0.037 ↑ 1.4 21 1

Subquery Scan on wlatest (cost=1.44..2.02 rows=29 width=40) (actual time=0.029..0.037 rows=21 loops=1)

48. 0.025 0.032 ↑ 1.4 21 1

HashAggregate (cost=1.44..1.73 rows=29 width=40) (actual time=0.029..0.032 rows=21 loops=1)

  • Group Key: reports2_1.ext_post_url
49. 0.007 0.007 ↑ 1.0 29 1

Seq Scan on ext_posts_reports reports2_1 (cost=0.00..1.29 rows=29 width=40) (actual time=0.003..0.007 rows=29 loops=1)

50. 0.021 0.039 ↑ 1.0 70 1

Hash (cost=1.70..1.70 rows=70 width=8) (actual time=0.039..0.039 rows=70 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
51. 0.018 0.018 ↑ 1.0 70 1

Seq Scan on creatives creatives_1 (cost=0.00..1.70 rows=70 width=8) (actual time=0.005..0.018 rows=70 loops=1)

52. 0.012 0.020 ↑ 1.0 29 1

Hash (cost=1.29..1.29 rows=29 width=4) (actual time=0.020..0.020 rows=29 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
53. 0.008 0.008 ↑ 1.0 29 1

Seq Scan on campaigns campaigns_2 (cost=0.00..1.29 rows=29 width=4) (actual time=0.003..0.008 rows=29 loops=1)

54. 0.017 0.134 ↑ 1.0 26 1

Hash (cost=7.29..7.29 rows=26 width=61) (actual time=0.134..0.134 rows=26 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
55. 0.018 0.117 ↑ 1.0 26 1

Hash Join (cost=4.23..7.29 rows=26 width=61) (actual time=0.086..0.117 rows=26 loops=1)

  • Hash Cond: (creatives.campaign_id = cs_8.id)
56. 0.020 0.081 ↑ 1.0 26 1

Hash Join (cost=2.58..5.56 rows=26 width=61) (actual time=0.057..0.081 rows=26 loops=1)

  • Hash Cond: (ext_posts.creative_id = creatives.id)
57. 0.022 0.022 ↑ 1.0 26 1

Seq Scan on campaign_social_links ext_posts (cost=0.00..2.91 rows=26 width=61) (actual time=0.007..0.022 rows=26 loops=1)

  • Filter: (platform = 'instagram'::social_platforms_single)
  • Rows Removed by Filter: 47
58. 0.017 0.039 ↑ 1.0 70 1

Hash (cost=1.70..1.70 rows=70 width=8) (actual time=0.039..0.039 rows=70 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
59. 0.022 0.022 ↑ 1.0 70 1

Seq Scan on creatives (cost=0.00..1.70 rows=70 width=8) (actual time=0.007..0.022 rows=70 loops=1)

60. 0.010 0.018 ↑ 1.0 29 1

Hash (cost=1.29..1.29 rows=29 width=4) (actual time=0.018..0.018 rows=29 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
61. 0.008 0.008 ↑ 1.0 29 1

Seq Scan on campaigns cs_8 (cost=0.00..1.29 rows=29 width=4) (actual time=0.004..0.008 rows=29 loops=1)

62. 0.046 538.669 ↑ 1.0 29 1

Materialize (cost=21,602.51..21,643.78 rows=29 width=476) (actual time=537.719..538.669 rows=29 loops=1)

63. 0.162 538.623 ↑ 1.0 29 1

Merge Left Join (cost=21,602.51..21,643.70 rows=29 width=476) (actual time=537.712..538.623 rows=29 loops=1)

  • Merge Cond: (cs_2.id = fb_posts_cov.campaign_id)
64. 0.113 311.075 ↑ 1.0 29 1

Merge Left Join (cost=13,494.26..13,534.09 rows=29 width=416) (actual time=310.322..311.075 rows=29 loops=1)

  • Merge Cond: (cs_2.id = fb_ext_posts.campaign_id)
65. 0.119 310.347 ↑ 1.0 29 1

Merge Left Join (cost=13,471.81..13,511.22 rows=29 width=428) (actual time=309.701..310.347 rows=29 loops=1)

  • Merge Cond: (cs_2.id = cs_5.id)
66. 0.049 309.346 ↑ 1.0 29 1

Merge Left Join (cost=13,444.63..13,483.54 rows=29 width=396) (actual time=308.815..309.346 rows=29 loops=1)

  • Merge Cond: (cs_2.id = junction_table_1.campaign_id)
67. 0.094 307.798 ↑ 1.0 29 1

Merge Left Join (cost=13,352.78..13,391.56 rows=29 width=384) (actual time=307.358..307.798 rows=29 loops=1)

  • Merge Cond: (cs_4.id = adswd.campaign_id)
68. 0.053 138.287 ↑ 1.0 29 1

Merge Left Join (cost=7,138.19..7,140.20 rows=29 width=80) (actual time=138.186..138.287 rows=29 loops=1)

  • Merge Cond: (cs_2.id = campaigns.id)
69. 0.024 1.107 ↑ 1.0 29 1

Sort (cost=47.50..47.57 rows=29 width=24) (actual time=1.104..1.107 rows=29 loops=1)

  • Sort Key: cs_2.id
  • Sort Method: quicksort Memory: 26kB
70. 0.019 1.083 ↑ 1.0 29 1

Hash Left Join (cost=44.62..46.79 rows=29 width=24) (actual time=1.042..1.083 rows=29 loops=1)

  • Hash Cond: (cs_3.id = fb_ext_posts_1.campaign_id)
71. 0.020 0.592 ↑ 1.0 29 1

Hash Left Join (cost=24.07..25.90 rows=29 width=20) (actual time=0.559..0.592 rows=29 loops=1)

  • Hash Cond: (cs_3.id = ig_ext_posts.campaign_id)
72. 0.023 0.091 ↑ 1.0 29 1

Hash Join (cost=3.30..4.77 rows=29 width=12) (actual time=0.066..0.091 rows=29 loops=1)

  • Hash Cond: (cs_4.id = cs_3.id)
73. 0.023 0.049 ↑ 1.0 29 1

Hash Join (cost=1.65..3.03 rows=29 width=8) (actual time=0.035..0.049 rows=29 loops=1)

  • Hash Cond: (cs_2.id = cs_4.id)
74. 0.008 0.008 ↑ 1.0 29 1

Seq Scan on campaigns cs_2 (cost=0.00..1.29 rows=29 width=4) (actual time=0.003..0.008 rows=29 loops=1)

75. 0.010 0.018 ↑ 1.0 29 1

Hash (cost=1.29..1.29 rows=29 width=4) (actual time=0.018..0.018 rows=29 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
76. 0.008 0.008 ↑ 1.0 29 1

Seq Scan on campaigns cs_4 (cost=0.00..1.29 rows=29 width=4) (actual time=0.003..0.008 rows=29 loops=1)

77. 0.012 0.019 ↑ 1.0 29 1

Hash (cost=1.29..1.29 rows=29 width=4) (actual time=0.019..0.019 rows=29 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
78. 0.007 0.007 ↑ 1.0 29 1

Seq Scan on campaigns cs_3 (cost=0.00..1.29 rows=29 width=4) (actual time=0.004..0.007 rows=29 loops=1)

79. 0.005 0.481 ↑ 4.3 6 1

Hash (cost=20.44..20.44 rows=26 width=12) (actual time=0.481..0.481 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
80. 0.002 0.476 ↑ 4.3 6 1

Subquery Scan on ig_ext_posts (cost=19.92..20.44 rows=26 width=12) (actual time=0.472..0.476 rows=6 loops=1)

81. 0.015 0.474 ↑ 4.3 6 1

HashAggregate (cost=19.92..20.18 rows=26 width=120) (actual time=0.472..0.474 rows=6 loops=1)

  • Group Key: cs_9.id, ext_posts_1.platform
82. 0.045 0.459 ↑ 1.0 26 1

Hash Right Join (cost=15.74..19.72 rows=26 width=12) (actual time=0.335..0.459 rows=26 loops=1)

  • Hash Cond: (links_1.url = ext_posts_1.url)
83. 0.032 0.279 ↑ 1.0 73 1

Hash Left Join (cost=8.13..11.57 rows=73 width=57) (actual time=0.188..0.279 rows=73 loops=1)

  • Hash Cond: (creatives_3.campaign_id = campaigns_3.id)
84. 0.033 0.230 ↑ 1.0 73 1

Hash Left Join (cost=6.48..9.70 rows=73 width=69) (actual time=0.159..0.230 rows=73 loops=1)

  • Hash Cond: (links_1.creative_id = creatives_3.id)
85. 0.046 0.161 ↑ 1.0 73 1

Hash Left Join (cost=3.90..6.92 rows=73 width=69) (actual time=0.112..0.161 rows=73 loops=1)

  • Hash Cond: (links_1.url = reports3_1.ext_post_url)
86. 0.018 0.018 ↑ 1.0 73 1

Seq Scan on campaign_social_links links_1 (cost=0.00..2.73 rows=73 width=65) (actual time=0.004..0.018 rows=73 loops=1)

87. 0.014 0.097 ↓ 21.0 21 1

Hash (cost=3.89..3.89 rows=1 width=36) (actual time=0.097..0.097 rows=21 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
88. 0.027 0.083 ↓ 21.0 21 1

Hash Join (cost=2.45..3.89 rows=1 width=36) (actual time=0.068..0.083 rows=21 loops=1)

  • Hash Cond: ((reports3_1.reported_at = wlatest_1.latest_report) AND (reports3_1.ext_post_url = wlatest_1.ext_post_url))
89. 0.004 0.004 ↑ 1.0 29 1

Seq Scan on ext_posts_reports reports3_1 (cost=0.00..1.29 rows=29 width=44) (actual time=0.003..0.004 rows=29 loops=1)

90. 0.010 0.052 ↑ 1.4 21 1

Hash (cost=2.02..2.02 rows=29 width=40) (actual time=0.051..0.052 rows=21 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
91. 0.007 0.042 ↑ 1.4 21 1

Subquery Scan on wlatest_1 (cost=1.44..2.02 rows=29 width=40) (actual time=0.029..0.042 rows=21 loops=1)

92. 0.032 0.035 ↑ 1.4 21 1

HashAggregate (cost=1.44..1.73 rows=29 width=40) (actual time=0.027..0.035 rows=21 loops=1)

  • Group Key: reports2_2.ext_post_url
93. 0.003 0.003 ↑ 1.0 29 1

Seq Scan on ext_posts_reports reports2_2 (cost=0.00..1.29 rows=29 width=40) (actual time=0.003..0.003 rows=29 loops=1)

94. 0.017 0.036 ↑ 1.0 70 1

Hash (cost=1.70..1.70 rows=70 width=8) (actual time=0.036..0.036 rows=70 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
95. 0.019 0.019 ↑ 1.0 70 1

Seq Scan on creatives creatives_3 (cost=0.00..1.70 rows=70 width=8) (actual time=0.005..0.019 rows=70 loops=1)

96. 0.010 0.017 ↑ 1.0 29 1

Hash (cost=1.29..1.29 rows=29 width=4) (actual time=0.017..0.017 rows=29 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
97. 0.007 0.007 ↑ 1.0 29 1

Seq Scan on campaigns campaigns_3 (cost=0.00..1.29 rows=29 width=4) (actual time=0.003..0.007 rows=29 loops=1)

98. 0.013 0.135 ↑ 1.0 26 1

Hash (cost=7.29..7.29 rows=26 width=61) (actual time=0.135..0.135 rows=26 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
99. 0.024 0.122 ↑ 1.0 26 1

Hash Join (cost=4.23..7.29 rows=26 width=61) (actual time=0.089..0.122 rows=26 loops=1)

  • Hash Cond: (creatives_2.campaign_id = cs_9.id)
100. 0.027 0.080 ↑ 1.0 26 1

Hash Join (cost=2.58..5.56 rows=26 width=61) (actual time=0.054..0.080 rows=26 loops=1)

  • Hash Cond: (ext_posts_1.creative_id = creatives_2.id)
101. 0.017 0.017 ↑ 1.0 26 1

Seq Scan on campaign_social_links ext_posts_1 (cost=0.00..2.91 rows=26 width=61) (actual time=0.004..0.017 rows=26 loops=1)

  • Filter: (platform = 'instagram'::social_platforms_single)
  • Rows Removed by Filter: 47
102. 0.021 0.036 ↑ 1.0 70 1

Hash (cost=1.70..1.70 rows=70 width=8) (actual time=0.036..0.036 rows=70 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
103. 0.015 0.015 ↑ 1.0 70 1

Seq Scan on creatives creatives_2 (cost=0.00..1.70 rows=70 width=8) (actual time=0.004..0.015 rows=70 loops=1)

104. 0.011 0.018 ↑ 1.0 29 1

Hash (cost=1.29..1.29 rows=29 width=4) (actual time=0.018..0.018 rows=29 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
105. 0.007 0.007 ↑ 1.0 29 1

Seq Scan on campaigns cs_9 (cost=0.00..1.29 rows=29 width=4) (actual time=0.003..0.007 rows=29 loops=1)

106. 0.005 0.472 ↑ 2.9 8 1

Hash (cost=20.27..20.27 rows=23 width=12) (actual time=0.472..0.472 rows=8 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
107. 0.005 0.467 ↑ 2.9 8 1

Subquery Scan on fb_ext_posts_1 (cost=19.81..20.27 rows=23 width=12) (actual time=0.461..0.467 rows=8 loops=1)

108. 0.018 0.462 ↑ 2.9 8 1

HashAggregate (cost=19.81..20.04 rows=23 width=120) (actual time=0.460..0.462 rows=8 loops=1)

  • Group Key: cs_10.id, ext_posts_2.platform
109. 0.041 0.444 ↑ 1.0 23 1

Hash Right Join (cost=15.69..19.64 rows=23 width=12) (actual time=0.340..0.444 rows=23 loops=1)

  • Hash Cond: (links_2.url = ext_posts_2.url)
110. 0.034 0.276 ↑ 1.0 73 1

Hash Left Join (cost=8.13..11.57 rows=73 width=57) (actual time=0.187..0.276 rows=73 loops=1)

  • Hash Cond: (creatives_5.campaign_id = campaigns_4.id)
111. 0.039 0.224 ↑ 1.0 73 1

Hash Left Join (cost=6.48..9.70 rows=73 width=69) (actual time=0.157..0.224 rows=73 loops=1)

  • Hash Cond: (links_2.creative_id = creatives_5.id)
112. 0.044 0.150 ↑ 1.0 73 1

Hash Left Join (cost=3.90..6.92 rows=73 width=69) (actual time=0.111..0.150 rows=73 loops=1)

  • Hash Cond: (links_2.url = reports3_2.ext_post_url)
113. 0.010 0.010 ↑ 1.0 73 1

Seq Scan on campaign_social_links links_2 (cost=0.00..2.73 rows=73 width=65) (actual time=0.004..0.010 rows=73 loops=1)

114. 0.006 0.096 ↓ 21.0 21 1

Hash (cost=3.89..3.89 rows=1 width=36) (actual time=0.096..0.096 rows=21 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
115. 0.034 0.090 ↓ 21.0 21 1

Hash Join (cost=2.45..3.89 rows=1 width=36) (actual time=0.067..0.090 rows=21 loops=1)

  • Hash Cond: ((reports3_2.reported_at = wlatest_2.latest_report) AND (reports3_2.ext_post_url = wlatest_2.ext_post_url))
116. 0.005 0.005 ↑ 1.0 29 1

Seq Scan on ext_posts_reports reports3_2 (cost=0.00..1.29 rows=29 width=44) (actual time=0.003..0.005 rows=29 loops=1)

117. 0.015 0.051 ↑ 1.4 21 1

Hash (cost=2.02..2.02 rows=29 width=40) (actual time=0.051..0.051 rows=21 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
118. 0.003 0.036 ↑ 1.4 21 1

Subquery Scan on wlatest_2 (cost=1.44..2.02 rows=29 width=40) (actual time=0.028..0.036 rows=21 loops=1)

119. 0.026 0.033 ↑ 1.4 21 1

HashAggregate (cost=1.44..1.73 rows=29 width=40) (actual time=0.027..0.033 rows=21 loops=1)

  • Group Key: reports2_3.ext_post_url
120. 0.007 0.007 ↑ 1.0 29 1

Seq Scan on ext_posts_reports reports2_3 (cost=0.00..1.29 rows=29 width=40) (actual time=0.003..0.007 rows=29 loops=1)

121. 0.014 0.035 ↑ 1.0 70 1

Hash (cost=1.70..1.70 rows=70 width=8) (actual time=0.035..0.035 rows=70 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
122. 0.021 0.021 ↑ 1.0 70 1

Seq Scan on creatives creatives_5 (cost=0.00..1.70 rows=70 width=8) (actual time=0.004..0.021 rows=70 loops=1)

123. 0.009 0.018 ↑ 1.0 29 1

Hash (cost=1.29..1.29 rows=29 width=4) (actual time=0.018..0.018 rows=29 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
124. 0.009 0.009 ↑ 1.0 29 1

Seq Scan on campaigns campaigns_4 (cost=0.00..1.29 rows=29 width=4) (actual time=0.004..0.009 rows=29 loops=1)

125. 0.016 0.127 ↑ 1.0 23 1

Hash (cost=7.27..7.27 rows=23 width=61) (actual time=0.127..0.127 rows=23 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
126. 0.016 0.111 ↑ 1.0 23 1

Hash Join (cost=4.23..7.27 rows=23 width=61) (actual time=0.083..0.111 rows=23 loops=1)

  • Hash Cond: (creatives_4.campaign_id = cs_10.id)
127. 0.021 0.077 ↑ 1.0 23 1

Hash Join (cost=2.58..5.55 rows=23 width=61) (actual time=0.055..0.077 rows=23 loops=1)

  • Hash Cond: (ext_posts_2.creative_id = creatives_4.id)
128. 0.018 0.018 ↑ 1.0 23 1

Seq Scan on campaign_social_links ext_posts_2 (cost=0.00..2.91 rows=23 width=61) (actual time=0.006..0.018 rows=23 loops=1)

  • Filter: (platform = 'facebook'::social_platforms_single)
  • Rows Removed by Filter: 50
129. 0.018 0.038 ↑ 1.0 70 1

Hash (cost=1.70..1.70 rows=70 width=8) (actual time=0.038..0.038 rows=70 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
130. 0.020 0.020 ↑ 1.0 70 1

Seq Scan on creatives creatives_4 (cost=0.00..1.70 rows=70 width=8) (actual time=0.004..0.020 rows=70 loops=1)

131. 0.009 0.018 ↑ 1.0 29 1

Hash (cost=1.29..1.29 rows=29 width=4) (actual time=0.018..0.018 rows=29 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
132. 0.009 0.009 ↑ 1.0 29 1

Seq Scan on campaigns cs_10 (cost=0.00..1.29 rows=29 width=4) (actual time=0.003..0.009 rows=29 loops=1)

133. 0.015 137.127 ↑ 1.0 29 1

Materialize (cost=7,090.69..7,092.20 rows=29 width=60) (actual time=137.079..137.127 rows=29 loops=1)

134. 0.031 137.112 ↑ 1.0 29 1

Merge Left Join (cost=7,090.69..7,092.12 rows=29 width=60) (actual time=137.076..137.112 rows=29 loops=1)

  • Merge Cond: (campaigns.id = campaign_posts.campaign_id)
135. 0.022 0.032 ↑ 1.0 29 1

Sort (cost=1.99..2.07 rows=29 width=4) (actual time=0.027..0.032 rows=29 loops=1)

  • Sort Key: campaigns.id
  • Sort Method: quicksort Memory: 26kB
136. 0.010 0.010 ↑ 1.0 29 1

Seq Scan on campaigns (cost=0.00..1.29 rows=29 width=4) (actual time=0.004..0.010 rows=29 loops=1)

137. 0.024 137.049 ↑ 10.0 20 1

Sort (cost=7,088.70..7,089.20 rows=200 width=60) (actual time=137.044..137.049 rows=20 loops=1)

  • Sort Key: campaign_posts.campaign_id
  • Sort Method: quicksort Memory: 26kB
138. 0.009 137.025 ↑ 10.0 20 1

Subquery Scan on campaign_posts (cost=7,076.55..7,081.05 rows=200 width=60) (actual time=137.007..137.025 rows=20 loops=1)

139. 5.966 137.016 ↑ 10.0 20 1

HashAggregate (cost=7,076.55..7,079.05 rows=200 width=140) (actual time=137.006..137.016 rows=20 loops=1)

  • Group Key: (COALESCE(fb_campaigns.campaign_id, cs_11.id))
140. 3.627 131.050 ↓ 1.0 13,972 1

Hash Left Join (cost=6,208.43..6,762.54 rows=13,956 width=32) (actual time=99.375..131.050 rows=13,972 loops=1)

  • Hash Cond: ((distributors.id = distributors_stats.distributor_id) AND ((COALESCE(fb_campaigns.campaign_id, cs_11.id)) = distributors_stats.campaign_id))
141. 3.509 127.407 ↓ 1.0 13,972 1

Hash Left Join (cost=6,207.17..6,687.98 rows=13,956 width=32) (actual time=99.346..127.407 rows=13,972 loops=1)

  • Hash Cond: (fb_profiles.id = distributors.fb_page_id)
142. 3.583 123.880 ↓ 1.0 13,972 1

Hash Left Join (cost=6,205.57..6,610.49 rows=13,956 width=36) (actual time=99.315..123.880 rows=13,972 loops=1)

  • Hash Cond: (fb_posts.from_fb_profile_id = fb_profiles.id)
143. 4.465 120.220 ↓ 1.0 13,972 1

Hash Left Join (cost=6,199.97..6,568.08 rows=13,956 width=36) (actual time=99.224..120.220 rows=13,972 loops=1)

  • Hash Cond: ((fb_posts.id)::text = (fpi2.fb_post_id)::text)
144. 9.026 114.971 ↓ 1.0 13,972 1

Hash Right Join (cost=6,087.48..6,403.25 rows=13,956 width=44) (actual time=98.420..114.971 rows=13,972 loops=1)

  • Hash Cond: ((fb_posts_1.id)::text = (fb_posts.id)::text)
145. 19.158 97.302 ↓ 1.0 13,972 1

HashAggregate (cost=5,591.47..5,731.03 rows=13,956 width=60) (actual time=89.697..97.302 rows=13,972 loops=1)

  • Group Key: fb_posts_1.id, COALESCE(fb_campaigns.campaign_id, cs_11.id), COALESCE(distributors_2.id, links_3.distributor_id), ig_media.owner_ig_user_id, (true), (cs_11.id IS NOT NULL), fb_ad_sets.publisher_platforms_has_facebook, ((NOT fb_ad_sets.publisher_platforms_has_facebook)), fb_ad_creatives.effective_instagram_story_id
146. 5.111 78.144 ↓ 1.0 13,972 1

Hash Left Join (cost=5,126.91..5,277.46 rows=13,956 width=60) (actual time=67.694..78.144 rows=13,972 loops=1)

  • Hash Cond: ((fb_posts_1.id)::text = (fb_posts_2.id)::text)
147. 4.354 62.088 ↓ 1.0 13,972 1

Hash Right Join (cost=4,316.39..4,411.92 rows=13,956 width=59) (actual time=56.727..62.088 rows=13,972 loops=1)

  • Hash Cond: ((fb_posts_1_1.id)::text = (fb_posts_1.id)::text)
148. 3.377 50.536 ↑ 2.1 2,021 1

HashAggregate (cost=3,820.38..3,862.60 rows=4,222 width=59) (actual time=49.446..50.536 rows=2,021 loops=1)

  • Group Key: fb_posts_1_1.id, fb_campaigns.campaign_id, distributors_2.id, fb_ad_sets.publisher_platforms_has_facebook, (NOT fb_ad_sets.publisher_platforms_has_facebook), fb_ad_creatives.effective_instagram_story_id, ig_media.owner_ig_user_id, true
149. 8.843 47.159 ↑ 2.0 2,150 1

Nested Loop Left Join (cost=1,585.01..3,735.94 rows=4,222 width=59) (actual time=23.801..47.159 rows=2,150 loops=1)

  • Join Filter: ((fb_posts_1_1.from_fb_profile_id = distributors_2.fb_page_id) OR (ig_media.owner_ig_user_id = distributors_2.ig_user_id))
  • Rows Removed by Join Filter: 57725
150. 1.406 34.016 ↑ 2.0 2,150 1

Hash Join (cost=1,585.01..1,739.71 rows=4,222 width=61) (actual time=23.769..34.016 rows=2,150 loops=1)

  • Hash Cond: (fb_ad_creatives.effective_instagram_story_id = ig_media.id)
151. 1.644 27.535 ↑ 1.0 4,222 1

Hash Join (cost=1,276.21..1,419.83 rows=4,222 width=53) (actual time=18.592..27.535 rows=4,222 loops=1)

  • Hash Cond: (fb_ad_sets.fb_campaign_id = fb_campaigns.id)
152. 1.819 25.096 ↑ 1.0 4,222 1

Hash Join (cost=1,215.56..1,348.06 rows=4,222 width=57) (actual time=17.774..25.096 rows=4,222 loops=1)

  • Hash Cond: (fb_ads.fb_ad_set_id = fb_ad_sets.id)
153. 2.653 22.319 ↑ 1.0 4,222 1

Hash Join (cost=1,150.32..1,271.71 rows=4,222 width=56) (actual time=16.798..22.319 rows=4,222 loops=1)

  • Hash Cond: ((fb_ad_creatives.effective_object_story_id)::text = (fb_posts_1_1.id)::text)
154. 2.350 11.783 ↑ 1.0 4,222 1

Hash Join (cost=654.31..764.62 rows=4,222 width=48) (actual time=8.827..11.783 rows=4,222 loops=1)

  • Hash Cond: (fb_ads.fb_ad_creative_id = fb_ad_creatives.id)
155. 0.698 0.698 ↑ 1.0 4,222 1

Seq Scan on fb_ads (cost=0.00..99.22 rows=4,222 width=16) (actual time=0.008..0.698 rows=4,222 loops=1)

156. 4.463 8.735 ↑ 1.0 13,525 1

Hash (cost=485.25..485.25 rows=13,525 width=48) (actual time=8.735..8.735 rows=13,525 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 1217kB
157. 4.272 4.272 ↑ 1.0 13,525 1

Seq Scan on fb_ad_creatives (cost=0.00..485.25 rows=13,525 width=48) (actual time=0.007..4.272 rows=13,525 loops=1)

158. 4.703 7.883 ↑ 1.0 13,956 1

Hash (cost=321.56..321.56 rows=13,956 width=40) (actual time=7.883..7.883 rows=13,956 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 1043kB
159. 3.180 3.180 ↑ 1.0 13,956 1

Seq Scan on fb_posts fb_posts_1_1 (cost=0.00..321.56 rows=13,956 width=40) (actual time=0.007..3.180 rows=13,956 loops=1)

160. 0.490 0.958 ↑ 1.0 1,655 1

Hash (cost=44.55..44.55 rows=1,655 width=17) (actual time=0.958..0.958 rows=1,655 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 107kB
161. 0.468 0.468 ↑ 1.0 1,655 1

Seq Scan on fb_ad_sets (cost=0.00..44.55 rows=1,655 width=17) (actual time=0.007..0.468 rows=1,655 loops=1)

162. 0.370 0.795 ↑ 1.0 1,451 1

Hash (cost=42.51..42.51 rows=1,451 width=12) (actual time=0.795..0.795 rows=1,451 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 74kB
163. 0.425 0.425 ↑ 1.0 1,451 1

Seq Scan on fb_campaigns (cost=0.00..42.51 rows=1,451 width=12) (actual time=0.012..0.425 rows=1,451 loops=1)

164. 2.702 5.075 ↑ 1.0 8,969 1

Hash (cost=196.69..196.69 rows=8,969 width=16) (actual time=5.075..5.075 rows=8,969 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 544kB
165. 2.373 2.373 ↑ 1.0 8,969 1

Seq Scan on ig_media (cost=0.00..196.69 rows=8,969 width=16) (actual time=0.010..2.373 rows=8,969 loops=1)

166. 4.286 4.300 ↑ 1.0 27 2,150

Materialize (cost=0.00..1.41 rows=27 width=20) (actual time=0.000..0.002 rows=27 loops=2,150)

167. 0.014 0.014 ↑ 1.0 27 1

Seq Scan on distributors distributors_2 (cost=0.00..1.27 rows=27 width=20) (actual time=0.010..0.014 rows=27 loops=1)

168. 4.502 7.198 ↑ 1.0 13,956 1

Hash (cost=321.56..321.56 rows=13,956 width=32) (actual time=7.197..7.198 rows=13,956 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 1011kB
169. 2.696 2.696 ↑ 1.0 13,956 1

Seq Scan on fb_posts fb_posts_1 (cost=0.00..321.56 rows=13,956 width=32) (actual time=0.011..2.696 rows=13,956 loops=1)

170. 0.018 10.945 ↑ 22.5 12 1

Hash (cost=807.14..807.14 rows=270 width=40) (actual time=10.945..10.945 rows=12 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
171. 0.018 10.927 ↑ 22.5 12 1

Hash Left Join (cost=428.98..807.14 rows=270 width=40) (actual time=8.108..10.927 rows=12 loops=1)

  • Hash Cond: (creatives_6.campaign_id = cs_11.id)
172. 0.019 10.886 ↑ 22.5 12 1

Hash Left Join (cost=427.33..804.68 rows=270 width=40) (actual time=8.071..10.886 rows=12 loops=1)

  • Hash Cond: (links_3.creative_id = creatives_6.id)
173. 1.298 10.817 ↑ 22.5 12 1

Hash Join (cost=424.75..801.35 rows=270 width=40) (actual time=8.009..10.817 rows=12 loops=1)

  • Hash Cond: (fb_posts_2.object_id = fb_videos_1.id)
174. 1.542 1.542 ↑ 1.0 13,956 1

Seq Scan on fb_posts fb_posts_2 (cost=0.00..321.56 rows=13,956 width=40) (actual time=0.010..1.542 rows=13,956 loops=1)

175. 0.011 7.977 ↑ 66.3 16 1

Hash (cost=411.49..411.49 rows=1,061 width=16) (actual time=7.977..7.977 rows=16 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 17kB
176. 0.020 7.966 ↑ 66.3 16 1

Hash Left Join (cost=20.25..411.49 rows=1,061 width=16) (actual time=0.929..7.966 rows=16 loops=1)

  • Hash Cond: (fb_pages.id = fb_pages_users.fb_page_id)
177. 5.720 7.669 ↑ 66.3 16 1

Hash Join (cost=9.57..396.70 rows=1,061 width=24) (actual time=0.647..7.669 rows=16 loops=1)

  • Hash Cond: ((fb_videos_1.id)::text = "substring"(links_3.url, '(?:.*/(?:videos)/)(.*)/$'::text))
178. 1.355 1.355 ↑ 1.0 9,230 1

Seq Scan on fb_videos fb_videos_1 (cost=0.00..307.30 rows=9,230 width=8) (actual time=0.005..1.355 rows=9,230 loops=1)

179. 0.418 0.594 ↑ 1.1 20 1

Hash (cost=9.28..9.28 rows=23 width=69) (actual time=0.594..0.594 rows=20 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
180. 0.053 0.176 ↑ 1.0 23 1

Hash Right Join (cost=4.88..9.28 rows=23 width=69) (actual time=0.123..0.176 rows=23 loops=1)

  • Hash Cond: (fb_pages.id = distributors_1.fb_page_id)
181. 0.022 0.022 ↑ 1.0 158 1

Seq Scan on fb_pages (cost=0.00..3.58 rows=158 width=8) (actual time=0.008..0.022 rows=158 loops=1)

182. 0.037 0.101 ↑ 1.0 23 1

Hash (cost=4.59..4.59 rows=23 width=69) (actual time=0.101..0.101 rows=23 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
183. 0.019 0.064 ↑ 1.0 23 1

Hash Left Join (cost=1.61..4.59 rows=23 width=69) (actual time=0.045..0.064 rows=23 loops=1)

  • Hash Cond: (links_3.distributor_id = distributors_1.id)
184. 0.021 0.021 ↑ 1.0 23 1

Seq Scan on campaign_social_links links_3 (cost=0.00..2.91 rows=23 width=61) (actual time=0.009..0.021 rows=23 loops=1)

  • Filter: (platform = 'facebook'::social_platforms_single)
  • Rows Removed by Filter: 50
185. 0.009 0.024 ↑ 1.0 27 1

Hash (cost=1.27..1.27 rows=27 width=12) (actual time=0.024..0.024 rows=27 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
186. 0.015 0.015 ↑ 1.0 27 1

Seq Scan on distributors distributors_1 (cost=0.00..1.27 rows=27 width=12) (actual time=0.007..0.015 rows=27 loops=1)

187. 0.019 0.277 ↓ 21.5 43 1

Hash (cost=10.65..10.65 rows=2 width=8) (actual time=0.277..0.277 rows=43 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
188. 0.016 0.258 ↓ 21.5 43 1

Nested Loop (cost=5.67..10.65 rows=2 width=8) (actual time=0.127..0.258 rows=43 loops=1)

  • Join Filter: (one_user.fb_page_id = fb_profiles_1.id)
189. 0.050 0.156 ↓ 21.5 43 1

Hash Join (cost=5.53..9.96 rows=2 width=16) (actual time=0.110..0.156 rows=43 loops=1)

  • Hash Cond: ((fb_pages_users.user_id = one_user.user_id) AND (fb_pages_users.fb_page_id = one_user.fb_page_id))
190. 0.015 0.015 ↑ 1.0 94 1

Seq Scan on fb_pages_users (cost=0.00..3.94 rows=94 width=12) (actual time=0.006..0.015 rows=94 loops=1)

191. 0.018 0.091 ↓ 1.1 43 1

Hash (cost=4.94..4.94 rows=39 width=12) (actual time=0.091..0.091 rows=43 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
192. 0.005 0.073 ↓ 1.1 43 1

Subquery Scan on one_user (cost=4.17..4.94 rows=39 width=12) (actual time=0.054..0.073 rows=43 loops=1)

193. 0.043 0.068 ↓ 1.1 43 1

HashAggregate (cost=4.17..4.55 rows=39 width=12) (actual time=0.054..0.068 rows=43 loops=1)

  • Group Key: fb_pages_users_1.fb_page_id
194. 0.025 0.025 ↑ 1.0 45 1

Seq Scan on fb_pages_users fb_pages_users_1 (cost=0.00..3.94 rows=45 width=12) (actual time=0.004..0.025 rows=45 loops=1)

  • Filter: ((access_token IS NOT NULL) AND can_advertise)
  • Rows Removed by Filter: 49
195. 0.086 0.086 ↑ 1.0 1 43

Index Only Scan using fb_profiles_pkey on fb_profiles fb_profiles_1 (cost=0.14..0.33 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=43)

  • Index Cond: (id = fb_pages_users.fb_page_id)
  • Heap Fetches: 43
196. 0.027 0.050 ↑ 1.0 70 1

Hash (cost=1.70..1.70 rows=70 width=8) (actual time=0.050..0.050 rows=70 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
197. 0.023 0.023 ↑ 1.0 70 1

Seq Scan on creatives creatives_6 (cost=0.00..1.70 rows=70 width=8) (actual time=0.011..0.023 rows=70 loops=1)

198. 0.012 0.023 ↑ 1.0 29 1

Hash (cost=1.29..1.29 rows=29 width=4) (actual time=0.023..0.023 rows=29 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
199. 0.011 0.011 ↑ 1.0 29 1

Seq Scan on campaigns cs_11 (cost=0.00..1.29 rows=29 width=4) (actual time=0.006..0.011 rows=29 loops=1)

200. 5.032 8.643 ↑ 1.0 13,956 1

Hash (cost=321.56..321.56 rows=13,956 width=48) (actual time=8.643..8.643 rows=13,956 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 1061kB
201. 3.611 3.611 ↑ 1.0 13,956 1

Seq Scan on fb_posts (cost=0.00..321.56 rows=13,956 width=48) (actual time=0.007..3.611 rows=13,956 loops=1)

202. 0.071 0.784 ↓ 136.0 136 1

Hash (cost=112.47..112.47 rows=1 width=55) (actual time=0.784..0.784 rows=136 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 21kB
203. 0.265 0.713 ↓ 136.0 136 1

Hash Join (cost=58.58..112.47 rows=1 width=55) (actual time=0.406..0.713 rows=136 loops=1)

  • Hash Cond: (((fpi.fb_post_id)::text = (fpi2.fb_post_id)::text) AND (fpi.fetched_from_fb_at = (max(fpi2.fetched_from_fb_at))))
204. 0.075 0.075 ↑ 1.0 321 1

Seq Scan on fb_post_insights fpi (cost=0.00..52.21 rows=321 width=55) (actual time=0.014..0.075 rows=321 loops=1)

205. 0.057 0.373 ↑ 1.0 136 1

Hash (cost=56.54..56.54 rows=136 width=39) (actual time=0.373..0.373 rows=136 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 19kB
206. 0.222 0.316 ↑ 1.0 136 1

HashAggregate (cost=53.82..55.18 rows=136 width=39) (actual time=0.277..0.316 rows=136 loops=1)

  • Group Key: fpi2.fb_post_id
207. 0.094 0.094 ↑ 1.0 321 1

Seq Scan on fb_post_insights fpi2 (cost=0.00..52.21 rows=321 width=39) (actual time=0.003..0.094 rows=321 loops=1)

208. 0.039 0.077 ↑ 1.0 160 1

Hash (cost=3.60..3.60 rows=160 width=8) (actual time=0.077..0.077 rows=160 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
209. 0.038 0.038 ↑ 1.0 160 1

Seq Scan on fb_profiles (cost=0.00..3.60 rows=160 width=8) (actual time=0.008..0.038 rows=160 loops=1)

210. 0.005 0.018 ↑ 3.9 7 1

Hash (cost=1.27..1.27 rows=27 width=12) (actual time=0.018..0.018 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
211. 0.013 0.013 ↑ 1.0 27 1

Seq Scan on distributors (cost=0.00..1.27 rows=27 width=12) (actual time=0.006..0.013 rows=27 loops=1)

212. 0.006 0.016 ↓ 7.0 7 1

Hash (cost=1.24..1.24 rows=1 width=12) (actual time=0.016..0.016 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
213. 0.010 0.010 ↓ 7.0 7 1

Seq Scan on distributors_stats (cost=0.00..1.24 rows=1 width=12) (actual time=0.006..0.010 rows=7 loops=1)

  • Filter: (platform = 'facebook'::social_platforms_single)
  • Rows Removed by Filter: 12
214. 0.271 169.417 ↑ 10.5 19 1

GroupAggregate (cost=6,214.60..6,248.28 rows=200 width=620) (actual time=169.161..169.417 rows=19 loops=1)

  • Group Key: adswd.campaign_id
215. 0.121 169.146 ↑ 4.0 115 1

Sort (cost=6,214.60..6,215.76 rows=464 width=115) (actual time=169.121..169.146 rows=115 loops=1)

  • Sort Key: adswd.campaign_id
  • Sort Method: quicksort Memory: 38kB
216. 0.030 169.025 ↑ 4.0 115 1

Subquery Scan on adswd (cost=6,181.29..6,194.05 rows=464 width=115) (actual time=168.819..169.025 rows=115 loops=1)

217. 52.706 168.995 ↑ 4.0 115 1

HashAggregate (cost=6,181.29..6,189.41 rows=464 width=155) (actual time=168.818..168.995 rows=115 loops=1)

  • Group Key: campaigns_5.id, junction_table.publisher_platform, ((fb_posts_3.is_hidden IS NOT NULL) AND fb_posts_3.is_hidden), ((fb_posts_3.is_hidden IS NOT NULL) AND (NOT fb_posts_3.is_hidden))
218. 4.428 116.289 ↓ 1.5 6,343 1

Hash Left Join (cost=3,205.91..3,458.10 rows=4,222 width=89) (actual time=83.187..116.289 rows=6,343 loops=1)

  • Hash Cond: (fb_ads_1.id = fb_ads_2.id)
219. 3.224 84.261 ↓ 1.5 6,343 1

Hash Left Join (cost=1,888.33..2,082.46 rows=4,222 width=92) (actual time=55.546..84.261 rows=6,343 loops=1)

  • Hash Cond: (fb_campaigns_1.campaign_id = campaigns_5.id)
220. 3.366 81.017 ↓ 1.5 6,343 1

Hash Join (cost=1,886.68..2,069.57 rows=4,222 width=92) (actual time=55.512..81.017 rows=6,343 loops=1)

  • Hash Cond: (fb_ad_sets_1.fb_campaign_id = fb_campaigns_1.id)
221. 3.760 76.758 ↓ 1.5 6,343 1

Hash Join (cost=1,826.03..1,997.81 rows=4,222 width=96) (actual time=54.599..76.758 rows=6,343 loops=1)

  • Hash Cond: (fb_ads_1.fb_ad_set_id = fb_ad_sets_1.id)
222. 2.478 72.171 ↓ 1.5 6,343 1

Hash Left Join (cost=1,760.79..1,921.45 rows=4,222 width=96) (actual time=53.750..72.171 rows=6,343 loops=1)

  • Hash Cond: (fb_posts_3.from_fb_profile_id = distributors_3.fb_page_id)
223. 5.342 69.663 ↓ 1.5 6,343 1

Hash Left Join (cost=1,759.19..1,896.41 rows=4,222 width=104) (actual time=53.701..69.663 rows=6,343 loops=1)

  • Hash Cond: ((fb_ad_creatives_1.effective_object_story_id)::text = (fb_posts_3.id)::text)
224. 4.573 55.824 ↓ 1.5 6,343 1

Hash Join (cost=1,263.18..1,389.32 rows=4,222 width=127) (actual time=45.107..55.824 rows=6,343 loops=1)

  • Hash Cond: (fb_ads_1.fb_ad_creative_id = fb_ad_creatives_1.id)
225. 5.405 42.661 ↓ 1.5 6,343 1

Hash Left Join (cost=608.86..723.93 rows=4,222 width=103) (actual time=36.435..42.661 rows=6,343 loops=1)

  • Hash Cond: (fb_ads_1.id = junction_table.fb_ad_id)
226. 0.851 0.851 ↑ 1.0 4,222 1

Seq Scan on fb_ads fb_ads_1 (cost=0.00..99.22 rows=4,222 width=24) (actual time=0.010..0.851 rows=4,222 loops=1)

227. 3.345 36.405 ↓ 4,226.0 4,226 1

Hash (cost=608.85..608.85 rows=1 width=87) (actual time=36.405..36.405 rows=4,226 loops=1)

  • Buckets: 8192 (originally 1024) Batches: 1 (originally 1) Memory Usage: 578kB
228. 6.559 33.060 ↓ 4,226.0 4,226 1

Nested Loop (cost=352.97..608.85 rows=1 width=87) (actual time=12.504..33.060 rows=4,226 loops=1)

229. 5.206 18.049 ↓ 4,226.0 4,226 1

Hash Join (cost=352.68..608.17 rows=1 width=33) (actual time=12.482..18.049 rows=4,226 loops=1)

  • Hash Cond: ((junction_table.fb_ad_id = wlatest_3.fb_ad_id) AND (junction_table.fetched_from_fb_at = wlatest_3.latest_fetch) AND ((junction_table.publisher_platform)::text = (wlatest_3.publisher_platform)::text))
230. 1.216 1.216 ↑ 1.0 8,587 1

Seq Scan on fb_ads_fb_marketing_api_insights junction_table (cost=0.00..187.87 rows=8,587 width=33) (actual time=0.007..1.216 rows=8,587 loops=1)

231. 2.037 11.627 ↓ 2.0 4,226 1

Hash (cost=315.84..315.84 rows=2,105 width=29) (actual time=11.627..11.627 rows=4,226 loops=1)

  • Buckets: 8192 (originally 4096) Batches: 1 (originally 1) Memory Usage: 317kB
232. 0.679 9.590 ↓ 2.0 4,226 1

Subquery Scan on wlatest_3 (cost=273.74..315.84 rows=2,105 width=29) (actual time=7.587..9.590 rows=4,226 loops=1)

233. 6.482 8.911 ↓ 2.0 4,226 1

HashAggregate (cost=273.74..294.79 rows=2,105 width=29) (actual time=7.586..8.911 rows=4,226 loops=1)

  • Group Key: junction_table2.fb_ad_id, junction_table2.publisher_platform
234. 2.429 2.429 ↑ 1.0 8,587 1

Seq Scan on fb_ads_fb_marketing_api_insights junction_table2 (cost=0.00..209.34 rows=8,587 width=29) (actual time=0.006..2.429 rows=8,587 loops=1)

  • Filter: (time_increment_enum = 'all_days'::text)
235. 8.452 8.452 ↑ 1.0 1 4,226

Index Scan using fb_marketing_api_insights_pkey on fb_marketing_api_insights api_insights (cost=0.29..0.68 rows=1 width=62) (actual time=0.002..0.002 rows=1 loops=4,226)

  • Index Cond: (id = junction_table.fb_marketing_api_insight_id)
236. 4.454 8.590 ↑ 1.0 13,525 1

Hash (cost=485.25..485.25 rows=13,525 width=48) (actual time=8.590..8.590 rows=13,525 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 1195kB
237. 4.136 4.136 ↑ 1.0 13,525 1

Seq Scan on fb_ad_creatives fb_ad_creatives_1 (cost=0.00..485.25 rows=13,525 width=48) (actual time=0.007..4.136 rows=13,525 loops=1)

238. 5.078 8.497 ↑ 1.0 13,956 1

Hash (cost=321.56..321.56 rows=13,956 width=41) (actual time=8.497..8.497 rows=13,956 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 1045kB
239. 3.419 3.419 ↑ 1.0 13,956 1

Seq Scan on fb_posts fb_posts_3 (cost=0.00..321.56 rows=13,956 width=41) (actual time=0.010..3.419 rows=13,956 loops=1)

240. 0.017 0.030 ↑ 3.9 7 1

Hash (cost=1.27..1.27 rows=27 width=8) (actual time=0.030..0.030 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
241. 0.013 0.013 ↑ 1.0 27 1

Seq Scan on distributors distributors_3 (cost=0.00..1.27 rows=27 width=8) (actual time=0.009..0.013 rows=27 loops=1)

242. 0.430 0.827 ↑ 1.0 1,655 1

Hash (cost=44.55..44.55 rows=1,655 width=16) (actual time=0.827..0.827 rows=1,655 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 94kB
243. 0.397 0.397 ↑ 1.0 1,655 1

Seq Scan on fb_ad_sets fb_ad_sets_1 (cost=0.00..44.55 rows=1,655 width=16) (actual time=0.009..0.397 rows=1,655 loops=1)

244. 0.430 0.893 ↑ 1.0 1,451 1

Hash (cost=42.51..42.51 rows=1,451 width=12) (actual time=0.893..0.893 rows=1,451 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 74kB
245. 0.463 0.463 ↑ 1.0 1,451 1

Seq Scan on fb_campaigns fb_campaigns_1 (cost=0.00..42.51 rows=1,451 width=12) (actual time=0.016..0.463 rows=1,451 loops=1)

246. 0.009 0.020 ↑ 1.0 29 1

Hash (cost=1.29..1.29 rows=29 width=4) (actual time=0.020..0.020 rows=29 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
247. 0.011 0.011 ↑ 1.0 29 1

Seq Scan on campaigns campaigns_5 (cost=0.00..1.29 rows=29 width=4) (actual time=0.006..0.011 rows=29 loops=1)

248. 1.399 27.600 ↑ 1.0 4,222 1

Hash (cost=1,264.81..1,264.81 rows=4,222 width=12) (actual time=27.600..27.600 rows=4,222 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 246kB
249. 7.521 26.201 ↑ 1.0 4,222 1

Hash Left Join (cost=1,079.56..1,264.81 rows=4,222 width=12) (actual time=13.903..26.201 rows=4,222 loops=1)

  • Hash Cond: (fb_videos.video_id = creatives_7.id)
250. 1.768 18.587 ↑ 1.0 4,222 1

Hash Left Join (cost=1,076.99..1,198.37 rows=4,222 width=53) (actual time=13.777..18.587 rows=4,222 loops=1)

  • Hash Cond: (fb_ad_creatives_2.fb_video_id = fb_videos.id)
251. 2.491 11.611 ↑ 1.0 4,222 1

Hash Left Join (cost=654.31..764.62 rows=4,222 width=57) (actual time=8.476..11.611 rows=4,222 loops=1)

  • Hash Cond: (fb_ads_2.fb_ad_creative_id = fb_ad_creatives_2.id)
252. 0.729 0.729 ↑ 1.0 4,222 1

Seq Scan on fb_ads fb_ads_2 (cost=0.00..99.22 rows=4,222 width=57) (actual time=0.006..0.729 rows=4,222 loops=1)

253. 4.220 8.391 ↑ 1.0 13,525 1

Hash (cost=485.25..485.25 rows=13,525 width=16) (actual time=8.391..8.391 rows=13,525 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 726kB
254. 4.171 4.171 ↑ 1.0 13,525 1

Seq Scan on fb_ad_creatives fb_ad_creatives_2 (cost=0.00..485.25 rows=13,525 width=16) (actual time=0.007..4.171 rows=13,525 loops=1)

255. 2.446 5.208 ↑ 1.0 9,230 1

Hash (cost=307.30..307.30 rows=9,230 width=12) (actual time=5.207..5.208 rows=9,230 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 489kB
256. 2.762 2.762 ↑ 1.0 9,230 1

Seq Scan on fb_videos (cost=0.00..307.30 rows=9,230 width=12) (actual time=0.011..2.762 rows=9,230 loops=1)

257. 0.018 0.093 ↑ 1.0 70 1

Hash (cost=1.70..1.70 rows=70 width=8) (actual time=0.093..0.093 rows=70 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
258. 0.075 0.075 ↑ 1.0 70 1

Seq Scan on creatives creatives_7 (cost=0.00..1.70 rows=70 width=8) (actual time=0.011..0.075 rows=70 loops=1)

259. 0.047 1.499 ↓ 13.0 13 1

GroupAggregate (cost=91.85..91.88 rows=1 width=20) (actual time=1.454..1.499 rows=13 loops=1)

  • Group Key: junction_table_1.campaign_id
260. 0.051 1.452 ↓ 43.0 43 1

Sort (cost=91.85..91.85 rows=1 width=24) (actual time=1.445..1.452 rows=43 loops=1)

  • Sort Key: junction_table_1.campaign_id
  • Sort Method: quicksort Memory: 28kB
261. 0.040 1.401 ↓ 43.0 43 1

Nested Loop (cost=45.94..91.84 rows=1 width=24) (actual time=0.884..1.401 rows=43 loops=1)

262. 0.366 1.232 ↓ 43.0 43 1

Hash Join (cost=45.65..88.63 rows=1 width=24) (actual time=0.863..1.232 rows=43 loops=1)

  • Hash Cond: ((junction_table_1.campaign_id = wlatest_4.campaign_id) AND (junction_table_1.fetched_from_fb_at = wlatest_4.latest_fetch) AND ((junction_table_1.publisher_platform)::text = (wlatest_4.publisher_platform)::text))
263. 0.134 0.134 ↑ 1.0 838 1

Seq Scan on campaigns_fb_marketing_api_insights junction_table_1 (cost=0.00..36.38 rows=838 width=32) (actual time=0.013..0.134 rows=838 loops=1)

264. 0.030 0.732 ↑ 1.2 43 1

Hash (cost=44.74..44.74 rows=52 width=28) (actual time=0.732..0.732 rows=43 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
265. 0.008 0.702 ↑ 1.1 47 1

Subquery Scan on wlatest_4 (cost=43.70..44.74 rows=52 width=28) (actual time=0.681..0.702 rows=47 loops=1)

266. 0.424 0.694 ↑ 1.1 47 1

HashAggregate (cost=43.70..44.22 rows=52 width=28) (actual time=0.680..0.694 rows=47 loops=1)

  • Group Key: campaigns_fb_marketing_api_insights.campaign_id, campaigns_fb_marketing_api_insights.publisher_platform
267. 0.270 0.270 ↑ 1.0 697 1

Seq Scan on campaigns_fb_marketing_api_insights (cost=0.00..38.48 rows=697 width=28) (actual time=0.016..0.270 rows=697 loops=1)

  • Filter: (time_increment_enum = 'all_days'::text)
  • Rows Removed by Filter: 141
268. 0.129 0.129 ↑ 1.0 1 43

Index Scan using fb_marketing_api_insights_pkey on fb_marketing_api_insights (cost=0.29..3.21 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=43)

  • Index Cond: (id = junction_table_1.fb_marketing_api_insight_id)
269. 0.032 0.882 ↑ 1.0 29 1

Sort (cost=27.17..27.25 rows=29 width=32) (actual time=0.875..0.882 rows=29 loops=1)

  • Sort Key: cs_5.id
  • Sort Method: quicksort Memory: 26kB
270. 0.037 0.850 ↑ 1.0 29 1

Hash Left Join (cost=24.81..26.47 rows=29 width=32) (actual time=0.834..0.850 rows=29 loops=1)

  • Hash Cond: (cs_5.id = eps.campaign_id)
271. 0.025 0.025 ↑ 1.0 29 1

Seq Scan on campaigns cs_5 (cost=0.00..1.29 rows=29 width=4) (actual time=0.017..0.025 rows=29 loops=1)

272. 0.007 0.788 ↑ 4.3 6 1

Hash (cost=24.48..24.48 rows=26 width=32) (actual time=0.788..0.788 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
273. 0.005 0.781 ↑ 4.3 6 1

Subquery Scan on eps (cost=23.96..24.48 rows=26 width=32) (actual time=0.776..0.781 rows=6 loops=1)

274. 0.044 0.776 ↑ 4.3 6 1

HashAggregate (cost=23.96..24.22 rows=26 width=120) (actual time=0.774..0.776 rows=6 loops=1)

  • Group Key: cs_12.id, ext_posts_3.platform
275. 0.051 0.732 ↑ 1.0 26 1

Hash Right Join (cost=17.27..22.73 rows=26 width=76) (actual time=0.459..0.732 rows=26 loops=1)

  • Hash Cond: (links_4.url = ext_posts_3.url)
276. 0.107 0.535 ↑ 1.0 73 1

Hash Left Join (cost=9.65..14.58 rows=73 width=121) (actual time=0.298..0.535 rows=73 loops=1)

  • Hash Cond: ((links_4.distributor_id = distributors_stats_1.distributor_id) AND (campaigns_6.id = distributors_stats_1.campaign_id) AND (links_4.platform = distributors_stats_1.platform))
277. 0.045 0.383 ↑ 1.0 73 1

Hash Left Join (cost=8.13..11.57 rows=73 width=137) (actual time=0.229..0.383 rows=73 loops=1)

  • Hash Cond: (creatives_9.campaign_id = campaigns_6.id)
278. 0.069 0.314 ↑ 1.0 73 1

Hash Left Join (cost=6.48..9.70 rows=73 width=137) (actual time=0.195..0.314 rows=73 loops=1)

  • Hash Cond: (links_4.creative_id = creatives_9.id)
279. 0.062 0.205 ↑ 1.0 73 1

Hash Left Join (cost=3.90..6.92 rows=73 width=137) (actual time=0.141..0.205 rows=73 loops=1)

  • Hash Cond: (links_4.url = reports3_3.ext_post_url)
280. 0.019 0.019 ↑ 1.0 73 1

Seq Scan on campaign_social_links links_4 (cost=0.00..2.73 rows=73 width=65) (actual time=0.004..0.019 rows=73 loops=1)

281. 0.021 0.124 ↓ 21.0 21 1

Hash (cost=3.89..3.89 rows=1 width=104) (actual time=0.124..0.124 rows=21 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
282. 0.044 0.103 ↓ 21.0 21 1

Hash Join (cost=2.45..3.89 rows=1 width=104) (actual time=0.077..0.103 rows=21 loops=1)

  • Hash Cond: ((reports3_3.reported_at = wlatest_5.latest_report) AND (reports3_3.ext_post_url = wlatest_5.ext_post_url))
283. 0.007 0.007 ↑ 1.0 29 1

Seq Scan on ext_posts_reports reports3_3 (cost=0.00..1.29 rows=29 width=112) (actual time=0.005..0.007 rows=29 loops=1)

284. 0.012 0.052 ↑ 1.4 21 1

Hash (cost=2.02..2.02 rows=29 width=40) (actual time=0.052..0.052 rows=21 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
285. 0.004 0.040 ↑ 1.4 21 1

Subquery Scan on wlatest_5 (cost=1.44..2.02 rows=29 width=40) (actual time=0.030..0.040 rows=21 loops=1)

286. 0.029 0.036 ↑ 1.4 21 1

HashAggregate (cost=1.44..1.73 rows=29 width=40) (actual time=0.030..0.036 rows=21 loops=1)

  • Group Key: reports2_4.ext_post_url
287. 0.007 0.007 ↑ 1.0 29 1

Seq Scan on ext_posts_reports reports2_4 (cost=0.00..1.29 rows=29 width=40) (actual time=0.003..0.007 rows=29 loops=1)

288. 0.020 0.040 ↑ 1.0 70 1

Hash (cost=1.70..1.70 rows=70 width=8) (actual time=0.040..0.040 rows=70 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
289. 0.020 0.020 ↑ 1.0 70 1

Seq Scan on creatives creatives_9 (cost=0.00..1.70 rows=70 width=8) (actual time=0.005..0.020 rows=70 loops=1)

290. 0.016 0.024 ↑ 1.0 29 1

Hash (cost=1.29..1.29 rows=29 width=4) (actual time=0.023..0.024 rows=29 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
291. 0.008 0.008 ↑ 1.0 29 1

Seq Scan on campaigns campaigns_6 (cost=0.00..1.29 rows=29 width=4) (actual time=0.004..0.008 rows=29 loops=1)

292. 0.034 0.045 ↑ 1.0 19 1

Hash (cost=1.19..1.19 rows=19 width=16) (actual time=0.045..0.045 rows=19 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
293. 0.011 0.011 ↑ 1.0 19 1

Seq Scan on distributors_stats distributors_stats_1 (cost=0.00..1.19 rows=19 width=16) (actual time=0.005..0.011 rows=19 loops=1)

294. 0.015 0.146 ↑ 1.0 26 1

Hash (cost=7.29..7.29 rows=26 width=61) (actual time=0.146..0.146 rows=26 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
295. 0.024 0.131 ↑ 1.0 26 1

Hash Join (cost=4.23..7.29 rows=26 width=61) (actual time=0.098..0.131 rows=26 loops=1)

  • Hash Cond: (creatives_8.campaign_id = cs_12.id)
296. 0.022 0.083 ↑ 1.0 26 1

Hash Join (cost=2.58..5.56 rows=26 width=61) (actual time=0.062..0.083 rows=26 loops=1)

  • Hash Cond: (ext_posts_3.creative_id = creatives_8.id)
297. 0.022 0.022 ↑ 1.0 26 1

Seq Scan on campaign_social_links ext_posts_3 (cost=0.00..2.91 rows=26 width=61) (actual time=0.007..0.022 rows=26 loops=1)

  • Filter: (platform = 'instagram'::social_platforms_single)
  • Rows Removed by Filter: 47
298. 0.021 0.039 ↑ 1.0 70 1

Hash (cost=1.70..1.70 rows=70 width=8) (actual time=0.039..0.039 rows=70 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
299. 0.018 0.018 ↑ 1.0 70 1

Seq Scan on creatives creatives_8 (cost=0.00..1.70 rows=70 width=8) (actual time=0.006..0.018 rows=70 loops=1)

300. 0.011 0.024 ↑ 1.0 29 1

Hash (cost=1.29..1.29 rows=29 width=4) (actual time=0.024..0.024 rows=29 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
301. 0.013 0.013 ↑ 1.0 29 1

Seq Scan on campaigns cs_12 (cost=0.00..1.29 rows=29 width=4) (actual time=0.008..0.013 rows=29 loops=1)

302. 0.019 0.615 ↑ 2.9 8 1

Sort (cost=22.46..22.51 rows=23 width=40) (actual time=0.611..0.615 rows=8 loops=1)

  • Sort Key: fb_ext_posts.campaign_id
  • Sort Method: quicksort Memory: 25kB
303. 0.003 0.596 ↑ 2.9 8 1

Subquery Scan on fb_ext_posts (cost=21.48..21.94 rows=23 width=40) (actual time=0.590..0.596 rows=8 loops=1)

304. 0.041 0.593 ↑ 2.9 8 1

HashAggregate (cost=21.48..21.71 rows=23 width=120) (actual time=0.589..0.593 rows=8 loops=1)

  • Group Key: cs_13.id, ext_posts_4.platform
305. 0.047 0.552 ↑ 1.0 23 1

Hash Right Join (cost=15.69..19.64 rows=23 width=72) (actual time=0.424..0.552 rows=23 loops=1)

  • Hash Cond: (links_5.url = ext_posts_4.url)
306. 0.042 0.368 ↑ 1.0 73 1

Hash Left Join (cost=8.13..11.57 rows=73 width=117) (actual time=0.254..0.368 rows=73 loops=1)

  • Hash Cond: (creatives_11.campaign_id = campaigns_7.id)
307. 0.055 0.307 ↑ 1.0 73 1

Hash Left Join (cost=6.48..9.70 rows=73 width=129) (actual time=0.222..0.307 rows=73 loops=1)

  • Hash Cond: (links_5.creative_id = creatives_11.id)
308. 0.058 0.212 ↑ 1.0 73 1

Hash Left Join (cost=3.90..6.92 rows=73 width=129) (actual time=0.158..0.212 rows=73 loops=1)

  • Hash Cond: (links_5.url = reports3_4.ext_post_url)
309. 0.014 0.014 ↑ 1.0 73 1

Seq Scan on campaign_social_links links_5 (cost=0.00..2.73 rows=73 width=65) (actual time=0.004..0.014 rows=73 loops=1)

310. 0.034 0.140 ↓ 21.0 21 1

Hash (cost=3.89..3.89 rows=1 width=96) (actual time=0.140..0.140 rows=21 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
311. 0.047 0.106 ↓ 21.0 21 1

Hash Join (cost=2.45..3.89 rows=1 width=96) (actual time=0.072..0.106 rows=21 loops=1)

  • Hash Cond: ((reports3_4.reported_at = wlatest_6.latest_report) AND (reports3_4.ext_post_url = wlatest_6.ext_post_url))
312. 0.008 0.008 ↑ 1.0 29 1

Seq Scan on ext_posts_reports reports3_4 (cost=0.00..1.29 rows=29 width=104) (actual time=0.004..0.008 rows=29 loops=1)

313. 0.013 0.051 ↑ 1.4 21 1

Hash (cost=2.02..2.02 rows=29 width=40) (actual time=0.051..0.051 rows=21 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
314. 0.006 0.038 ↑ 1.4 21 1

Subquery Scan on wlatest_6 (cost=1.44..2.02 rows=29 width=40) (actual time=0.028..0.038 rows=21 loops=1)

315. 0.026 0.032 ↑ 1.4 21 1

HashAggregate (cost=1.44..1.73 rows=29 width=40) (actual time=0.028..0.032 rows=21 loops=1)

  • Group Key: reports2_5.ext_post_url
316. 0.006 0.006 ↑ 1.0 29 1

Seq Scan on ext_posts_reports reports2_5 (cost=0.00..1.29 rows=29 width=40) (actual time=0.003..0.006 rows=29 loops=1)

317. 0.018 0.040 ↑ 1.0 70 1

Hash (cost=1.70..1.70 rows=70 width=8) (actual time=0.040..0.040 rows=70 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
318. 0.022 0.022 ↑ 1.0 70 1

Seq Scan on creatives creatives_11 (cost=0.00..1.70 rows=70 width=8) (actual time=0.009..0.022 rows=70 loops=1)

319. 0.010 0.019 ↑ 1.0 29 1

Hash (cost=1.29..1.29 rows=29 width=4) (actual time=0.019..0.019 rows=29 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
320. 0.009 0.009 ↑ 1.0 29 1

Seq Scan on campaigns campaigns_7 (cost=0.00..1.29 rows=29 width=4) (actual time=0.005..0.009 rows=29 loops=1)

321. 0.017 0.137 ↑ 1.0 23 1

Hash (cost=7.27..7.27 rows=23 width=61) (actual time=0.137..0.137 rows=23 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
322. 0.021 0.120 ↑ 1.0 23 1

Hash Join (cost=4.23..7.27 rows=23 width=61) (actual time=0.090..0.120 rows=23 loops=1)

  • Hash Cond: (creatives_10.campaign_id = cs_13.id)
323. 0.020 0.079 ↑ 1.0 23 1

Hash Join (cost=2.58..5.55 rows=23 width=61) (actual time=0.058..0.079 rows=23 loops=1)

  • Hash Cond: (ext_posts_4.creative_id = creatives_10.id)
324. 0.021 0.021 ↑ 1.0 23 1

Seq Scan on campaign_social_links ext_posts_4 (cost=0.00..2.91 rows=23 width=61) (actual time=0.006..0.021 rows=23 loops=1)

  • Filter: (platform = 'facebook'::social_platforms_single)
  • Rows Removed by Filter: 50
325. 0.022 0.038 ↑ 1.0 70 1

Hash (cost=1.70..1.70 rows=70 width=8) (actual time=0.038..0.038 rows=70 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
326. 0.016 0.016 ↑ 1.0 70 1

Seq Scan on creatives creatives_10 (cost=0.00..1.70 rows=70 width=8) (actual time=0.004..0.016 rows=70 loops=1)

327. 0.009 0.020 ↑ 1.0 29 1

Hash (cost=1.29..1.29 rows=29 width=4) (actual time=0.020..0.020 rows=29 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
328. 0.011 0.011 ↑ 1.0 29 1

Seq Scan on campaigns cs_13 (cost=0.00..1.29 rows=29 width=4) (actual time=0.005..0.011 rows=29 loops=1)

329. 0.022 227.386 ↑ 10.0 20 1

Sort (cost=8,108.25..8,108.75 rows=200 width=100) (actual time=227.381..227.386 rows=20 loops=1)

  • Sort Key: fb_posts_cov.campaign_id
  • Sort Method: quicksort Memory: 26kB
330. 0.004 227.364 ↑ 10.0 20 1

Subquery Scan on fb_posts_cov (cost=8,095.11..8,100.61 rows=200 width=100) (actual time=227.343..227.364 rows=20 loops=1)

331. 8.829 227.360 ↑ 10.0 20 1

HashAggregate (cost=8,095.11..8,098.61 rows=200 width=108) (actual time=227.341..227.360 rows=20 loops=1)

  • Group Key: (COALESCE(fb_campaigns_2.campaign_id, cs_14.id))
332. 3.930 218.531 ↓ 1.0 13,972 1

Hash Left Join (cost=6,740.29..7,257.75 rows=13,956 width=44) (actual time=181.603..218.531 rows=13,972 loops=1)

  • Hash Cond: (fb_profiles_2.id = distributors_4.fb_page_id)
333. 4.314 214.584 ↓ 1.0 13,972 1

Hash Left Join (cost=6,738.68..7,180.25 rows=13,956 width=52) (actual time=181.571..214.584 rows=13,972 loops=1)

  • Hash Cond: (fb_posts_4.from_fb_profile_id = fb_profiles_2.id)
334. 5.425 210.189 ↓ 1.0 13,972 1

Hash Left Join (cost=6,733.08..7,137.84 rows=13,956 width=52) (actual time=181.482..210.189 rows=13,972 loops=1)

  • Hash Cond: ((fb_posts_4.id)::text = (wads.fb_post_id)::text)
335. 5.256 124.116 ↓ 1.0 13,972 1

Hash Left Join (cost=6,199.97..6,568.08 rows=13,956 width=76) (actual time=100.817..124.116 rows=13,972 loops=1)

  • Hash Cond: ((fb_posts_4.id)::text = (fpi2_1.fb_post_id)::text)
336. 10.029 117.748 ↓ 1.0 13,972 1

Hash Right Join (cost=6,087.48..6,403.25 rows=13,956 width=44) (actual time=99.682..117.748 rows=13,972 loops=1)

  • Hash Cond: ((fb_posts_5.id)::text = (fb_posts_4.id)::text)
337. 19.853 99.137 ↓ 1.0 13,972 1

HashAggregate (cost=5,591.47..5,731.03 rows=13,956 width=60) (actual time=91.001..99.137 rows=13,972 loops=1)

  • Group Key: fb_posts_5.id, COALESCE(fb_campaigns_2.campaign_id, cs_14.id), COALESCE(distributors_6.id, links_6.distributor_id), ig_media_1.owner_ig_user_id, (true), (cs_14.id IS NOT NULL), fb_ad_sets_2.publisher_platforms_has_facebook, ((NOT fb_ad_sets_2.publisher_platforms_has_facebook)), fb_ad_creatives_3.effective_instagram_story_id
338. 5.022 79.284 ↓ 1.0 13,972 1

Hash Left Join (cost=5,126.91..5,277.46 rows=13,956 width=60) (actual time=68.988..79.284 rows=13,972 loops=1)

  • Hash Cond: ((fb_posts_5.id)::text = (fb_posts_6.id)::text)
339. 4.305 63.271 ↓ 1.0 13,972 1

Hash Right Join (cost=4,316.39..4,411.92 rows=13,956 width=59) (actual time=57.976..63.271 rows=13,972 loops=1)

  • Hash Cond: ((fb_posts_1_2.id)::text = (fb_posts_5.id)::text)
340. 3.577 51.373 ↑ 2.1 2,021 1

HashAggregate (cost=3,820.38..3,862.60 rows=4,222 width=59) (actual time=50.274..51.373 rows=2,021 loops=1)

  • Group Key: fb_posts_1_2.id, fb_campaigns_2.campaign_id, distributors_6.id, fb_ad_sets_2.publisher_platforms_has_facebook, (NOT fb_ad_sets_2.publisher_platforms_has_facebook), fb_ad_creatives_3.effective_instagram_story_id, ig_media_1.owner_ig_user_id, true
341. 8.673 47.796 ↑ 2.0 2,150 1

Nested Loop Left Join (cost=1,585.01..3,735.94 rows=4,222 width=59) (actual time=24.015..47.796 rows=2,150 loops=1)

  • Join Filter: ((fb_posts_1_2.from_fb_profile_id = distributors_6.fb_page_id) OR (ig_media_1.owner_ig_user_id = distributors_6.ig_user_id))
  • Rows Removed by Join Filter: 57725
342. 1.467 34.823 ↑ 2.0 2,150 1

Hash Join (cost=1,585.01..1,739.71 rows=4,222 width=61) (actual time=23.979..34.823 rows=2,150 loops=1)

  • Hash Cond: (fb_ad_creatives_3.effective_instagram_story_id = ig_media_1.id)
343. 1.730 28.690 ↑ 1.0 4,222 1

Hash Join (cost=1,276.21..1,419.83 rows=4,222 width=53) (actual time=19.221..28.690 rows=4,222 loops=1)

  • Hash Cond: (fb_ad_sets_2.fb_campaign_id = fb_campaigns_2.id)
344. 1.815 26.143 ↑ 1.0 4,222 1

Hash Join (cost=1,215.56..1,348.06 rows=4,222 width=57) (actual time=18.386..26.143 rows=4,222 loops=1)

  • Hash Cond: (fb_ads_3.fb_ad_set_id = fb_ad_sets_2.id)
345. 2.850 23.265 ↑ 1.0 4,222 1

Hash Join (cost=1,150.32..1,271.71 rows=4,222 width=56) (actual time=17.304..23.265 rows=4,222 loops=1)

  • Hash Cond: ((fb_ad_creatives_3.effective_object_story_id)::text = (fb_posts_1_2.id)::text)
346. 2.561 12.205 ↑ 1.0 4,222 1

Hash Join (cost=654.31..764.62 rows=4,222 width=48) (actual time=8.995..12.205 rows=4,222 loops=1)

  • Hash Cond: (fb_ads_3.fb_ad_creative_id = fb_ad_creatives_3.id)
347. 0.753 0.753 ↑ 1.0 4,222 1

Seq Scan on fb_ads fb_ads_3 (cost=0.00..99.22 rows=4,222 width=16) (actual time=0.012..0.753 rows=4,222 loops=1)

348. 4.611 8.891 ↑ 1.0 13,525 1

Hash (cost=485.25..485.25 rows=13,525 width=48) (actual time=8.891..8.891 rows=13,525 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 1217kB
349. 4.280 4.280 ↑ 1.0 13,525 1

Seq Scan on fb_ad_creatives fb_ad_creatives_3 (cost=0.00..485.25 rows=13,525 width=48) (actual time=0.007..4.280 rows=13,525 loops=1)

350. 4.941 8.210 ↑ 1.0 13,956 1

Hash (cost=321.56..321.56 rows=13,956 width=40) (actual time=8.210..8.210 rows=13,956 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 1043kB
351. 3.269 3.269 ↑ 1.0 13,956 1

Seq Scan on fb_posts fb_posts_1_2 (cost=0.00..321.56 rows=13,956 width=40) (actual time=0.008..3.269 rows=13,956 loops=1)

352. 0.528 1.063 ↑ 1.0 1,655 1

Hash (cost=44.55..44.55 rows=1,655 width=17) (actual time=1.063..1.063 rows=1,655 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 107kB
353. 0.535 0.535 ↑ 1.0 1,655 1

Seq Scan on fb_ad_sets fb_ad_sets_2 (cost=0.00..44.55 rows=1,655 width=17) (actual time=0.008..0.535 rows=1,655 loops=1)

354. 0.359 0.817 ↑ 1.0 1,451 1

Hash (cost=42.51..42.51 rows=1,451 width=12) (actual time=0.817..0.817 rows=1,451 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 74kB
355. 0.458 0.458 ↑ 1.0 1,451 1

Seq Scan on fb_campaigns fb_campaigns_2 (cost=0.00..42.51 rows=1,451 width=12) (actual time=0.011..0.458 rows=1,451 loops=1)

356. 2.470 4.666 ↑ 1.0 8,969 1

Hash (cost=196.69..196.69 rows=8,969 width=16) (actual time=4.666..4.666 rows=8,969 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 544kB
357. 2.196 2.196 ↑ 1.0 8,969 1

Seq Scan on ig_media ig_media_1 (cost=0.00..196.69 rows=8,969 width=16) (actual time=0.012..2.196 rows=8,969 loops=1)

358. 4.282 4.300 ↑ 1.0 27 2,150

Materialize (cost=0.00..1.41 rows=27 width=20) (actual time=0.000..0.002 rows=27 loops=2,150)

359. 0.018 0.018 ↑ 1.0 27 1

Seq Scan on distributors distributors_6 (cost=0.00..1.27 rows=27 width=20) (actual time=0.012..0.018 rows=27 loops=1)

360. 4.794 7.593 ↑ 1.0 13,956 1

Hash (cost=321.56..321.56 rows=13,956 width=32) (actual time=7.593..7.593 rows=13,956 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 1011kB
361. 2.799 2.799 ↑ 1.0 13,956 1

Seq Scan on fb_posts fb_posts_5 (cost=0.00..321.56 rows=13,956 width=32) (actual time=0.012..2.799 rows=13,956 loops=1)

362. 0.010 10.991 ↑ 22.5 12 1

Hash (cost=807.14..807.14 rows=270 width=40) (actual time=10.991..10.991 rows=12 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
363. 0.019 10.981 ↑ 22.5 12 1

Hash Left Join (cost=428.98..807.14 rows=270 width=40) (actual time=8.126..10.981 rows=12 loops=1)

  • Hash Cond: (creatives_12.campaign_id = cs_14.id)
364. 0.018 10.940 ↑ 22.5 12 1

Hash Left Join (cost=427.33..804.68 rows=270 width=40) (actual time=8.090..10.940 rows=12 loops=1)

  • Hash Cond: (links_6.creative_id = creatives_12.id)
365. 1.317 10.880 ↑ 22.5 12 1

Hash Join (cost=424.75..801.35 rows=270 width=40) (actual time=8.035..10.880 rows=12 loops=1)

  • Hash Cond: (fb_posts_6.object_id = fb_videos_1_1.id)
366. 1.560 1.560 ↑ 1.0 13,956 1

Seq Scan on fb_posts fb_posts_6 (cost=0.00..321.56 rows=13,956 width=40) (actual time=0.012..1.560 rows=13,956 loops=1)

367. 0.011 8.003 ↑ 66.3 16 1

Hash (cost=411.49..411.49 rows=1,061 width=16) (actual time=8.003..8.003 rows=16 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 17kB
368. 0.016 7.992 ↑ 66.3 16 1

Hash Left Join (cost=20.25..411.49 rows=1,061 width=16) (actual time=1.343..7.992 rows=16 loops=1)

  • Hash Cond: (fb_pages_1.id = fb_pages_users_2.fb_page_id)
369. 5.478 7.566 ↑ 66.3 16 1

Hash Join (cost=9.57..396.70 rows=1,061 width=24) (actual time=0.926..7.566 rows=16 loops=1)

  • Hash Cond: ((fb_videos_1_1.id)::text = "substring"(links_6.url, '(?:.*/(?:videos)/)(.*)/$'::text))
370. 1.225 1.225 ↑ 1.0 9,230 1

Seq Scan on fb_videos fb_videos_1_1 (cost=0.00..307.30 rows=9,230 width=8) (actual time=0.005..1.225 rows=9,230 loops=1)

371. 0.664 0.863 ↑ 1.1 20 1

Hash (cost=9.28..9.28 rows=23 width=69) (actual time=0.863..0.863 rows=20 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
372. 0.055 0.199 ↑ 1.0 23 1

Hash Right Join (cost=4.88..9.28 rows=23 width=69) (actual time=0.139..0.199 rows=23 loops=1)

  • Hash Cond: (fb_pages_1.id = distributors_5.fb_page_id)
373. 0.027 0.027 ↑ 1.0 158 1

Seq Scan on fb_pages fb_pages_1 (cost=0.00..3.58 rows=158 width=8) (actual time=0.008..0.027 rows=158 loops=1)

374. 0.017 0.117 ↑ 1.0 23 1

Hash (cost=4.59..4.59 rows=23 width=69) (actual time=0.117..0.117 rows=23 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
375. 0.052 0.100 ↑ 1.0 23 1

Hash Left Join (cost=1.61..4.59 rows=23 width=69) (actual time=0.079..0.100 rows=23 loops=1)

  • Hash Cond: (links_6.distributor_id = distributors_5.id)
376. 0.024 0.024 ↑ 1.0 23 1

Seq Scan on campaign_social_links links_6 (cost=0.00..2.91 rows=23 width=61) (actual time=0.010..0.024 rows=23 loops=1)

  • Filter: (platform = 'facebook'::social_platforms_single)
  • Rows Removed by Filter: 50
377. 0.007 0.024 ↑ 1.0 27 1

Hash (cost=1.27..1.27 rows=27 width=12) (actual time=0.024..0.024 rows=27 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
378. 0.017 0.017 ↑ 1.0 27 1

Seq Scan on distributors distributors_5 (cost=0.00..1.27 rows=27 width=12) (actual time=0.007..0.017 rows=27 loops=1)

379. 0.033 0.410 ↓ 21.5 43 1

Hash (cost=10.65..10.65 rows=2 width=8) (actual time=0.410..0.410 rows=43 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
380. 0.053 0.377 ↓ 21.5 43 1

Nested Loop (cost=5.67..10.65 rows=2 width=8) (actual time=0.163..0.377 rows=43 loops=1)

  • Join Filter: (one_user_1.fb_page_id = fb_profiles_3.id)
381. 0.046 0.195 ↓ 21.5 43 1

Hash Join (cost=5.53..9.96 rows=2 width=16) (actual time=0.137..0.195 rows=43 loops=1)

  • Hash Cond: ((fb_pages_users_2.user_id = one_user_1.user_id) AND (fb_pages_users_2.fb_page_id = one_user_1.fb_page_id))
382. 0.030 0.030 ↑ 1.0 94 1

Seq Scan on fb_pages_users fb_pages_users_2 (cost=0.00..3.94 rows=94 width=12) (actual time=0.009..0.030 rows=94 loops=1)

383. 0.020 0.119 ↓ 1.1 43 1

Hash (cost=4.94..4.94 rows=39 width=12) (actual time=0.119..0.119 rows=43 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
384. 0.012 0.099 ↓ 1.1 43 1

Subquery Scan on one_user_1 (cost=4.17..4.94 rows=39 width=12) (actual time=0.073..0.099 rows=43 loops=1)

385. 0.053 0.087 ↓ 1.1 43 1

HashAggregate (cost=4.17..4.55 rows=39 width=12) (actual time=0.072..0.087 rows=43 loops=1)

  • Group Key: fb_pages_users_1_1.fb_page_id
386. 0.034 0.034 ↑ 1.0 45 1

Seq Scan on fb_pages_users fb_pages_users_1_1 (cost=0.00..3.94 rows=45 width=12) (actual time=0.005..0.034 rows=45 loops=1)

  • Filter: ((access_token IS NOT NULL) AND can_advertise)
  • Rows Removed by Filter: 49
387. 0.129 0.129 ↑ 1.0 1 43

Index Only Scan using fb_profiles_pkey on fb_profiles fb_profiles_3 (cost=0.14..0.33 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=43)

  • Index Cond: (id = fb_pages_users_2.fb_page_id)
  • Heap Fetches: 43
388. 0.019 0.042 ↑ 1.0 70 1

Hash (cost=1.70..1.70 rows=70 width=8) (actual time=0.042..0.042 rows=70 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
389. 0.023 0.023 ↑ 1.0 70 1

Seq Scan on creatives creatives_12 (cost=0.00..1.70 rows=70 width=8) (actual time=0.008..0.023 rows=70 loops=1)

390. 0.013 0.022 ↑ 1.0 29 1

Hash (cost=1.29..1.29 rows=29 width=4) (actual time=0.022..0.022 rows=29 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
391. 0.009 0.009 ↑ 1.0 29 1

Seq Scan on campaigns cs_14 (cost=0.00..1.29 rows=29 width=4) (actual time=0.005..0.009 rows=29 loops=1)

392. 5.172 8.582 ↑ 1.0 13,956 1

Hash (cost=321.56..321.56 rows=13,956 width=48) (actual time=8.582..8.582 rows=13,956 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 1061kB
393. 3.410 3.410 ↑ 1.0 13,956 1

Seq Scan on fb_posts fb_posts_4 (cost=0.00..321.56 rows=13,956 width=48) (actual time=0.007..3.410 rows=13,956 loops=1)

394. 0.136 1.112 ↓ 136.0 136 1

Hash (cost=112.47..112.47 rows=1 width=63) (actual time=1.112..1.112 rows=136 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 21kB
395. 0.417 0.976 ↓ 136.0 136 1

Hash Join (cost=58.58..112.47 rows=1 width=63) (actual time=0.417..0.976 rows=136 loops=1)

  • Hash Cond: (((fpi_1.fb_post_id)::text = (fpi2_1.fb_post_id)::text) AND (fpi_1.fetched_from_fb_at = (max(fpi2_1.fetched_from_fb_at))))
396. 0.178 0.178 ↑ 1.0 321 1

Seq Scan on fb_post_insights fpi_1 (cost=0.00..52.21 rows=321 width=71) (actual time=0.016..0.178 rows=321 loops=1)

397. 0.058 0.381 ↑ 1.0 136 1

Hash (cost=56.54..56.54 rows=136 width=39) (actual time=0.381..0.381 rows=136 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 19kB
398. 0.221 0.323 ↑ 1.0 136 1

HashAggregate (cost=53.82..55.18 rows=136 width=39) (actual time=0.288..0.323 rows=136 loops=1)

  • Group Key: fpi2_1.fb_post_id
399. 0.102 0.102 ↑ 1.0 321 1

Seq Scan on fb_post_insights fpi2_1 (cost=0.00..52.21 rows=321 width=39) (actual time=0.003..0.102 rows=321 loops=1)

400. 0.128 80.648 ↓ 326.0 326 1

Hash (cost=533.10..533.10 rows=1 width=40) (actual time=80.648..80.648 rows=326 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 32kB
401. 0.058 80.520 ↓ 326.0 326 1

Subquery Scan on wads (cost=533.07..533.10 rows=1 width=40) (actual time=79.894..80.520 rows=326 loops=1)

402. 0.507 80.462 ↓ 326.0 326 1

GroupAggregate (cost=533.07..533.09 rows=1 width=128) (actual time=79.892..80.462 rows=326 loops=1)

  • Group Key: fb_posts_7.id
403. 6.759 79.955 ↓ 1,072.0 1,072 1

Sort (cost=533.07..533.07 rows=1 width=48) (actual time=79.885..79.955 rows=1,072 loops=1)

  • Sort Key: fb_posts_7.id
  • Sort Method: quicksort Memory: 139kB
404. 0.466 73.196 ↓ 1,072.0 1,072 1

Nested Loop (cost=489.72..533.06 rows=1 width=48) (actual time=6.789..73.196 rows=1,072 loops=1)

405. 0.797 69.514 ↓ 1,072.0 1,072 1

Nested Loop (cost=489.44..532.68 rows=1 width=56) (actual time=6.776..69.514 rows=1,072 loops=1)

406. 1.358 65.501 ↓ 1,072.0 1,072 1

Nested Loop (cost=489.16..532.35 rows=1 width=56) (actual time=6.762..65.501 rows=1,072 loops=1)

407. 4.178 59.855 ↓ 1,072.0 1,072 1

Nested Loop Left Join (cost=488.88..530.52 rows=1 width=44) (actual time=6.746..59.855 rows=1,072 loops=1)

408. 1.023 17.085 ↓ 1,072.0 1,072 1

Nested Loop (cost=488.48..528.73 rows=1 width=44) (actual time=6.677..17.085 rows=1,072 loops=1)

409. 1.137 12.846 ↓ 1,072.0 1,072 1

Nested Loop (cost=488.19..528.06 rows=1 width=20) (actual time=6.665..12.846 rows=1,072 loops=1)

410. 1.109 8.493 ↓ 1,072.0 1,072 1

Hash Join (cost=487.91..527.63 rows=1 width=20) (actual time=6.652..8.493 rows=1,072 loops=1)

  • Hash Cond: ((junction_table2_1.fb_ad_id = junction_table_2.fb_ad_id) AND ((max(junction_table2_1.fetched_from_fb_at)) = junction_table_2.fetched_from_fb_at))
411. 1.973 4.213 ↑ 1.3 1,072 1

HashAggregate (cost=246.73..261.17 rows=1,444 width=29) (actual time=3.434..4.213 rows=1,072 loops=1)

  • Group Key: junction_table2_1.fb_ad_id, junction_table2_1.publisher_platform
412. 2.240 2.240 ↑ 1.0 2,123 1

Seq Scan on fb_ads_fb_marketing_api_insights junction_table2_1 (cost=0.00..230.81 rows=2,123 width=29) (actual time=0.011..2.240 rows=2,123 loops=1)

  • Filter: ((time_increment_enum = 'all_days'::text) AND ((publisher_platform)::text = 'facebook'::text))
  • Rows Removed by Filter: 6464
413. 0.890 3.171 ↑ 1.0 2,123 1

Hash (cost=209.34..209.34 rows=2,123 width=33) (actual time=3.171..3.171 rows=2,123 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 165kB
414. 2.281 2.281 ↑ 1.0 2,123 1

Seq Scan on fb_ads_fb_marketing_api_insights junction_table_2 (cost=0.00..209.34 rows=2,123 width=33) (actual time=0.012..2.281 rows=2,123 loops=1)

  • Filter: ((publisher_platform)::text = 'facebook'::text)
  • Rows Removed by Filter: 6464
415. 3.216 3.216 ↑ 1.0 1 1,072

Index Scan using fb_ads_pkey on fb_ads fb_ads_4 (cost=0.28..0.43 rows=1 width=24) (actual time=0.003..0.003 rows=1 loops=1,072)

  • Index Cond: (id = junction_table_2.fb_ad_id)
416. 3.216 3.216 ↑ 1.0 1 1,072

Index Scan using fb_ad_creatives_pkey on fb_ad_creatives fb_ad_creatives_4 (cost=0.29..0.67 rows=1 width=48) (actual time=0.003..0.003 rows=1 loops=1,072)

  • Index Cond: (id = fb_ads_4.fb_ad_creative_id)
417. 12.864 38.592 ↑ 1.0 1 1,072

Hash Right Join (cost=0.40..1.78 rows=1 width=32) (actual time=0.031..0.036 rows=1 loops=1,072)

  • Hash Cond: (distributors_7.fb_page_id = fb_posts_7.from_fb_profile_id)
418. 4.288 4.288 ↑ 1.0 27 1,072

Seq Scan on distributors distributors_7 (cost=0.00..1.27 rows=27 width=8) (actual time=0.001..0.004 rows=27 loops=1,072)

419. 1.072 21.440 ↑ 1.0 1 1,072

Hash (cost=0.39..0.39 rows=1 width=40) (actual time=0.020..0.020 rows=1 loops=1,072)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
420. 20.368 20.368 ↑ 1.0 1 1,072

Index Scan using fb_posts_pkey on fb_posts fb_posts_7 (cost=0.29..0.39 rows=1 width=40) (actual time=0.019..0.019 rows=1 loops=1,072)

  • Index Cond: ((fb_ad_creatives_4.effective_object_story_id)::text = (id)::text)
421. 4.288 4.288 ↑ 1.0 1 1,072

Index Scan using fb_marketing_api_insights_pkey on fb_marketing_api_insights api_insights_1 (cost=0.29..1.83 rows=1 width=20) (actual time=0.004..0.004 rows=1 loops=1,072)

  • Index Cond: ((id = junction_table_2.fb_marketing_api_insight_id) AND (id IS NOT NULL))
422. 3.216 3.216 ↑ 1.0 1 1,072

Index Scan using fb_ad_sets_pkey on fb_ad_sets fb_ad_sets_3 (cost=0.28..0.33 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=1,072)

  • Index Cond: (id = fb_ads_4.fb_ad_set_id)
423. 3.216 3.216 ↑ 1.0 1 1,072

Index Scan using fb_campaigns_pkey on fb_campaigns fb_campaigns_3 (cost=0.28..0.38 rows=1 width=12) (actual time=0.003..0.003 rows=1 loops=1,072)

  • Index Cond: (id = fb_ad_sets_3.fb_campaign_id)
424. 0.041 0.081 ↑ 1.0 160 1

Hash (cost=3.60..3.60 rows=160 width=8) (actual time=0.080..0.081 rows=160 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
425. 0.040 0.040 ↑ 1.0 160 1

Seq Scan on fb_profiles fb_profiles_2 (cost=0.00..3.60 rows=160 width=8) (actual time=0.011..0.040 rows=160 loops=1)

426. 0.005 0.017 ↑ 3.9 7 1

Hash (cost=1.27..1.27 rows=27 width=12) (actual time=0.017..0.017 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
427. 0.012 0.012 ↑ 1.0 27 1

Seq Scan on distributors distributors_4 (cost=0.00..1.27 rows=27 width=12) (actual time=0.005..0.012 rows=27 loops=1)

428. 0.171 294.793 ↑ 1.0 29 1

GroupAggregate (cost=15,708.78..15,724.65 rows=29 width=160) (actual time=294.532..294.793 rows=29 loops=1)

  • Group Key: campaigns_8.id
429. 0.049 294.622 ↑ 5.8 66 1

Merge Left Join (cost=15,708.78..15,717.35 rows=384 width=40) (actual time=294.505..294.622 rows=66 loops=1)

  • Merge Cond: (campaigns_8.id = campaigns_9.id)
430. 0.031 0.053 ↑ 1.0 29 1

Sort (cost=1.99..2.07 rows=29 width=4) (actual time=0.047..0.053 rows=29 loops=1)

  • Sort Key: campaigns_8.id
  • Sort Method: quicksort Memory: 26kB
431. 0.022 0.022 ↑ 1.0 29 1

Seq Scan on campaigns campaigns_8 (cost=0.00..1.29 rows=29 width=4) (actual time=0.017..0.022 rows=29 loops=1)

432. 0.028 294.520 ↑ 8.9 43 1

Materialize (cost=15,706.78..15,710.41 rows=384 width=40) (actual time=294.456..294.520 rows=43 loops=1)

433. 0.029 294.492 ↑ 8.9 43 1

Merge Join (cost=15,706.78..15,709.45 rows=384 width=40) (actual time=294.453..294.492 rows=43 loops=1)

  • Merge Cond: (g_ads_campaigns2.campaign_id = campaigns_9.id)
434. 0.165 294.412 ↑ 8.7 44 1

Sort (cost=15,704.79..15,705.75 rows=384 width=40) (actual time=294.403..294.412 rows=44 loops=1)

  • Sort Key: g_ads_campaigns2.campaign_id
  • Sort Method: quicksort Memory: 46kB
435. 0.149 294.247 ↑ 1.4 277 1

Hash Left Join (cost=15,670.00..15,688.30 rows=384 width=40) (actual time=293.006..294.247 rows=277 loops=1)

  • Hash Cond: (gc_with_report.g_ads_campaign_id = gc_with_ad_video_stats.g_ads_campaign_id)
436. 0.174 56.947 ↑ 1.0 277 1

Merge Join (cost=2,918.29..2,935.86 rows=277 width=40) (actual time=55.827..56.947 rows=277 loops=1)

  • Merge Cond: (gc_with_report.g_ads_campaign_id = g_ads_campaigns2.id)
437. 0.183 56.559 ↑ 1.0 277 1

Subquery Scan on gc_with_report (cost=2,900.28..2,913.00 rows=277 width=36) (actual time=55.636..56.559 rows=277 loops=1)

438. 0.394 56.376 ↑ 1.0 277 1

GroupAggregate (cost=2,900.28..2,908.15 rows=277 width=104) (actual time=55.628..56.376 rows=277 loops=1)

  • Group Key: g_campaigns.id
439. 0.287 55.982 ↓ 2.0 554 1

Merge Left Join (cost=2,900.28..2,901.92 rows=277 width=80) (actual time=55.616..55.982 rows=554 loops=1)

  • Merge Cond: (g_campaigns.id = gc_reports2.google_campaign_id)
440. 0.146 0.212 ↑ 1.0 277 1

Sort (cost=18.01..18.70 rows=277 width=52) (actual time=0.188..0.212 rows=277 loops=1)

  • Sort Key: g_campaigns.id
  • Sort Method: quicksort Memory: 56kB
441. 0.066 0.066 ↑ 1.0 277 1

Seq Scan on google_campaigns g_campaigns (cost=0.00..6.77 rows=277 width=52) (actual time=0.008..0.066 rows=277 loops=1)

442. 0.356 55.483 ↓ 32.6 554 1

Sort (cost=2,882.27..2,882.32 rows=17 width=36) (actual time=55.424..55.483 rows=554 loops=1)

  • Sort Key: gc_reports2.google_campaign_id
  • Sort Method: quicksort Memory: 68kB
443. 19.486 55.127 ↓ 32.6 554 1

Hash Join (cost=1,444.35..2,881.93 rows=17 width=36) (actual time=37.970..55.127 rows=554 loops=1)

  • Hash Cond: ((gc_reports2.google_campaign_id = wlatest_7.g_campaign_id) AND (gc_reports2.fetched_at = wlatest_7.latest_fetch) AND (gc_reports2.is_unique_cookies_report = wlatest_7.is_unique_cookies_report))
444. 5.035 5.035 ↑ 1.0 37,347 1

Seq Scan on google_ad_campaign_performance_reports gc_reports2 (cost=0.00..1,143.47 rows=37,347 width=45) (actual time=0.007..5.035 rows=37,347 loops=1)

445. 0.234 30.606 ↑ 1.0 554 1

Hash (cost=1,434.65..1,434.65 rows=554 width=17) (actual time=30.606..30.606 rows=554 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 35kB
446. 0.085 30.372 ↑ 1.0 554 1

Subquery Scan on wlatest_7 (cost=1,423.57..1,434.65 rows=554 width=17) (actual time=30.148..30.372 rows=554 loops=1)

447. 24.985 30.287 ↑ 1.0 554 1

HashAggregate (cost=1,423.57..1,429.11 rows=554 width=17) (actual time=30.147..30.287 rows=554 loops=1)

  • Group Key: gc_reports.google_campaign_id, gc_reports.is_unique_cookies_report
448. 5.302 5.302 ↑ 1.0 37,347 1

Seq Scan on google_ad_campaign_performance_reports gc_reports (cost=0.00..1,143.47 rows=37,347 width=17) (actual time=0.003..5.302 rows=37,347 loops=1)

449. 0.138 0.214 ↑ 1.0 277 1

Sort (cost=18.01..18.70 rows=277 width=12) (actual time=0.187..0.214 rows=277 loops=1)

  • Sort Key: g_ads_campaigns2.id
  • Sort Method: quicksort Memory: 37kB
450. 0.076 0.076 ↑ 1.0 277 1

Seq Scan on google_campaigns g_ads_campaigns2 (cost=0.00..6.77 rows=277 width=12) (actual time=0.012..0.076 rows=277 loops=1)

451. 0.076 237.151 ↑ 1.1 260 1

Hash (cost=12,748.25..12,748.25 rows=277 width=16) (actual time=237.151..237.151 rows=260 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 21kB
452. 0.045 237.075 ↑ 1.1 260 1

Subquery Scan on gc_with_ad_video_stats (cost=12,742.71..12,748.25 rows=277 width=16) (actual time=236.965..237.075 rows=260 loops=1)

453. 17.551 237.030 ↑ 1.1 260 1

HashAggregate (cost=12,742.71..12,745.48 rows=277 width=24) (actual time=236.964..237.030 rows=260 loops=1)

  • Group Key: google_campaigns.id
454. 10.017 219.479 ↑ 1.0 27,997 1

Hash Left Join (cost=9,090.74..10,082.99 rows=27,997 width=40) (actual time=180.555..219.479 rows=27,997 loops=1)

  • Hash Cond: (google_ad_groups.google_campaign_id = google_campaigns.id)
455. 11.704 209.313 ↑ 1.0 27,997 1

Hash Left Join (cost=9,080.51..9,998.15 rows=27,997 width=40) (actual time=180.390..209.313 rows=27,997 loops=1)

  • Hash Cond: (google_ads.google_ad_group_id = google_ad_groups.id)
456. 12.581 196.765 ↑ 1.0 27,997 1

Hash Left Join (cost=9,028.97..9,872.92 rows=27,997 width=40) (actual time=179.524..196.765 rows=27,997 loops=1)

  • Hash Cond: ((google_ads.id = reports2_6.google_ad_id) AND (google_ads.google_ad_group_id = reports2_6.google_ad_group_id))
457. 4.683 4.683 ↑ 1.0 27,997 1

Seq Scan on google_ads (cost=0.00..633.97 rows=27,997 width=16) (actual time=0.009..4.683 rows=27,997 loops=1)

458. 1.064 179.501 ↓ 1,553.0 1,553 1

Hash (cost=9,028.95..9,028.95 rows=1 width=48) (actual time=179.501..179.501 rows=1,553 loops=1)

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 144kB
459. 2.068 178.437 ↓ 1,553.0 1,553 1

Nested Loop Left Join (cost=4,133.24..9,028.95 rows=1 width=48) (actual time=153.719..178.437 rows=1,553 loops=1)

460. 72.475 162.392 ↓ 1,553.0 1,553 1

Hash Join (cost=4,132.96..9,028.65 rows=1 width=56) (actual time=153.676..162.392 rows=1,553 loops=1)

  • Hash Cond: ((reports2_6.google_ad_id = reports_2.google_ad_id) AND (reports2_6.google_ad_group_id = reports_2.google_ad_group_id) AND ((reports2_6.yt_video_id)::text = (reports_2.yt_video_id)::text) AND (reports2_6.fetched_at = (max(reports_2.fetched_at))))
461. 17.279 17.279 ↑ 1.0 123,107 1

Seq Scan on google_ads_video_performance_reports reports2_6 (cost=0.00..3,603.07 rows=123,107 width=64) (actual time=0.006..17.279 rows=123,107 loops=1)

462. 0.795 72.638 ↑ 6.0 1,553 1

Hash (cost=3,947.98..3,947.98 rows=9,249 width=36) (actual time=72.638..72.638 rows=1,553 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 238kB
463. 26.107 71.843 ↑ 6.0 1,553 1

HashAggregate (cost=3,763.00..3,855.49 rows=9,249 width=36) (actual time=71.243..71.843 rows=1,553 loops=1)

  • Group Key: reports_2.google_ad_id, reports_2.google_ad_group_id, reports_2.yt_video_id
464. 45.736 45.736 ↓ 2.8 44,639 1

Seq Scan on google_ads_video_performance_reports reports_2 (cost=0.00..3,603.07 rows=15,993 width=36) (actual time=28.130..45.736 rows=44,639 loops=1)

  • Filter: ((network IS NULL) AND (network_with_search_partners IS NULL))
  • Rows Removed by Filter: 78468
465. 13.977 13.977 ↑ 1.0 1 1,553

Index Scan using yt_videos_pkey on yt_videos (cost=0.28..0.30 rows=1 width=16) (actual time=0.009..0.009 rows=1 loops=1,553)

  • Index Cond: ((reports2_6.yt_video_id)::text = (id)::text)
466. 0.478 0.844 ↑ 1.0 1,624 1

Hash (cost=31.24..31.24 rows=1,624 width=16) (actual time=0.844..0.844 rows=1,624 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 93kB
467. 0.366 0.366 ↑ 1.0 1,624 1

Seq Scan on google_ad_groups (cost=0.00..31.24 rows=1,624 width=16) (actual time=0.013..0.366 rows=1,624 loops=1)

468. 0.081 0.149 ↑ 1.0 277 1

Hash (cost=6.77..6.77 rows=277 width=12) (actual time=0.149..0.149 rows=277 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 19kB
469. 0.068 0.068 ↑ 1.0 277 1

Seq Scan on google_campaigns (cost=0.00..6.77 rows=277 width=12) (actual time=0.009..0.068 rows=277 loops=1)

470. 0.034 0.051 ↑ 1.0 28 1

Sort (cost=1.99..2.07 rows=29 width=4) (actual time=0.045..0.051 rows=28 loops=1)

  • Sort Key: campaigns_9.id
  • Sort Method: quicksort Memory: 26kB
471. 0.017 0.017 ↑ 1.0 29 1

Seq Scan on campaigns campaigns_9 (cost=0.00..1.29 rows=29 width=4) (actual time=0.012..0.017 rows=29 loops=1)

472. 0.126 369.957 ↑ 2.6 7 1

GroupAggregate (cost=24,697.45..24,699.43 rows=18 width=472) (actual time=369.865..369.957 rows=7 loops=1)

  • Group Key: (COALESCE(g_ads_video_ov.campaign_id, COALESCE(campaigns_10.id, boosted.campaign_id)))
473. 0.038 369.831 ↓ 1.8 32 1

Sort (cost=24,697.45..24,697.49 rows=18 width=228) (actual time=369.829..369.831 rows=32 loops=1)

  • Sort Key: (COALESCE(g_ads_video_ov.campaign_id, COALESCE(campaigns_10.id, boosted.campaign_id)))
  • Sort Method: quicksort Memory: 28kB
474. 0.055 369.793 ↓ 1.8 32 1

Hash Right Join (cost=24,693.18..24,697.07 rows=18 width=228) (actual time=369.677..369.793 rows=32 loops=1)

  • Hash Cond: (links_7.url = s_links.url)
475. 0.036 0.350 ↑ 1.0 73 1

Hash Left Join (cost=8.13..11.57 rows=73 width=133) (actual time=0.229..0.350 rows=73 loops=1)

  • Hash Cond: (creatives_14.campaign_id = campaigns_11.id)
476. 0.052 0.293 ↑ 1.0 73 1

Hash Left Join (cost=6.48..9.70 rows=73 width=145) (actual time=0.197..0.293 rows=73 loops=1)

  • Hash Cond: (links_7.creative_id = creatives_14.id)
477. 0.072 0.202 ↑ 1.0 73 1

Hash Left Join (cost=3.90..6.92 rows=73 width=145) (actual time=0.145..0.202 rows=73 loops=1)

  • Hash Cond: (links_7.url = reports3_5.ext_post_url)
478. 0.017 0.017 ↑ 1.0 73 1

Seq Scan on campaign_social_links links_7 (cost=0.00..2.73 rows=73 width=65) (actual time=0.007..0.017 rows=73 loops=1)

479. 0.018 0.113 ↓ 21.0 21 1

Hash (cost=3.89..3.89 rows=1 width=112) (actual time=0.113..0.113 rows=21 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
480. 0.039 0.095 ↓ 21.0 21 1

Hash Join (cost=2.45..3.89 rows=1 width=112) (actual time=0.070..0.095 rows=21 loops=1)

  • Hash Cond: ((reports3_5.reported_at = wlatest_8.latest_report) AND (reports3_5.ext_post_url = wlatest_8.ext_post_url))
481. 0.008 0.008 ↑ 1.0 29 1

Seq Scan on ext_posts_reports reports3_5 (cost=0.00..1.29 rows=29 width=112) (actual time=0.005..0.008 rows=29 loops=1)

482. 0.013 0.048 ↑ 1.4 21 1

Hash (cost=2.02..2.02 rows=29 width=40) (actual time=0.048..0.048 rows=21 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
483. 0.003 0.035 ↑ 1.4 21 1

Subquery Scan on wlatest_8 (cost=1.44..2.02 rows=29 width=40) (actual time=0.026..0.035 rows=21 loops=1)

484. 0.028 0.032 ↑ 1.4 21 1

HashAggregate (cost=1.44..1.73 rows=29 width=40) (actual time=0.026..0.032 rows=21 loops=1)

  • Group Key: reports2_7.ext_post_url
485. 0.004 0.004 ↑ 1.0 29 1

Seq Scan on ext_posts_reports reports2_7 (cost=0.00..1.29 rows=29 width=40) (actual time=0.003..0.004 rows=29 loops=1)

486. 0.016 0.039 ↑ 1.0 70 1

Hash (cost=1.70..1.70 rows=70 width=8) (actual time=0.039..0.039 rows=70 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
487. 0.023 0.023 ↑ 1.0 70 1

Seq Scan on creatives creatives_14 (cost=0.00..1.70 rows=70 width=8) (actual time=0.008..0.023 rows=70 loops=1)

488. 0.009 0.021 ↑ 1.0 29 1

Hash (cost=1.29..1.29 rows=29 width=4) (actual time=0.021..0.021 rows=29 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
489. 0.012 0.012 ↑ 1.0 29 1

Seq Scan on campaigns campaigns_11 (cost=0.00..1.29 rows=29 width=4) (actual time=0.006..0.012 rows=29 loops=1)

490. 0.031 369.388 ↓ 1.8 32 1

Hash (cost=24,684.82..24,684.82 rows=18 width=209) (actual time=369.388..369.388 rows=32 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
491. 0.033 369.357 ↓ 1.8 32 1

Hash Left Join (cost=24,683.82..24,684.82 rows=18 width=209) (actual time=369.190..369.357 rows=32 loops=1)

  • Hash Cond: ((g_ads_video_ov.yt_video_id)::text = (yt_stats_1.yt_video_id)::text)
492. 0.037 369.291 ↓ 1.8 32 1

Merge Left Join (cost=24,682.16..24,682.92 rows=18 width=213) (actual time=369.140..369.291 rows=32 loops=1)

  • Merge Cond: ((g_ads_video_ov.yt_video_id)::text = (au_traffic_views.yt_video_id)::text)
493. 0.061 369.166 ↓ 1.8 32 1

Merge Left Join (cost=24,676.12..24,676.56 rows=18 width=181) (actual time=369.049..369.166 rows=32 loops=1)

  • Merge Cond: ((g_ads_video_ov.yt_video_id)::text = (global_traffic_views.yt_video_id)::text)
494. 0.056 368.852 ↓ 1.8 32 1

Merge Left Join (cost=24,668.47..24,668.58 rows=18 width=149) (actual time=368.793..368.852 rows=32 loops=1)

  • Merge Cond: ((g_ads_video_ov.yt_video_id)::text = (yt_stats.yt_video_id)::text)
495. 0.135 368.674 ↓ 1.8 32 1

Sort (cost=24,667.17..24,667.22 rows=18 width=101) (actual time=368.669..368.674 rows=32 loops=1)

  • Sort Key: g_ads_video_ov.yt_video_id
  • Sort Method: quicksort Memory: 28kB
496. 0.095 368.539 ↓ 1.8 32 1

Hash Left Join (cost=24,663.63..24,666.80 rows=18 width=101) (actual time=367.171..368.539 rows=32 loops=1)

  • Hash Cond: ((COALESCE(boosted.yt_video_id, ("substring"(s_links.url, '(?:.*)(?:youtube.com/watch.?v=)(.*)'::text))::character varying))::text = (g_ads_video_ov.yt_video_id)::text)
497. 1.384 183.182 ↓ 1.8 32 1

Hash Full Join (cost=12,180.87..12,183.99 rows=18 width=73) (actual time=181.832..183.182 rows=32 loops=1)

  • Hash Cond: ("substring"(s_links.url, '(?:.*)(?:youtube.com/watch.?v=)(.*)'::text) = (boosted.yt_video_id)::text)
498. 0.030 0.162 ↑ 1.0 18 1

Hash Join (cost=4.23..7.25 rows=18 width=57) (actual time=0.117..0.162 rows=18 loops=1)

  • Hash Cond: (creatives_13.campaign_id = campaigns_10.id)
499. 0.028 0.105 ↑ 1.0 18 1

Hash Join (cost=2.58..5.53 rows=18 width=57) (actual time=0.068..0.105 rows=18 loops=1)

  • Hash Cond: (s_links.creative_id = creatives_13.id)
500. 0.035 0.035 ↑ 1.0 18 1

Seq Scan on campaign_social_links s_links (cost=0.00..2.91 rows=18 width=57) (actual time=0.012..0.035 rows=18 loops=1)

  • Filter: (platform = 'youtube'::social_platforms_single)
  • Rows Removed by Filter: 55
501. 0.023 0.042 ↑ 1.0 70 1

Hash (cost=1.70..1.70 rows=70 width=8) (actual time=0.042..0.042 rows=70 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
502. 0.019 0.019 ↑ 1.0 70 1

Seq Scan on creatives creatives_13 (cost=0.00..1.70 rows=70 width=8) (actual time=0.007..0.019 rows=70 loops=1)

503. 0.010 0.027 ↑ 1.0 29 1

Hash (cost=1.29..1.29 rows=29 width=4) (actual time=0.027..0.027 rows=29 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
504. 0.017 0.017 ↑ 1.0 29 1

Seq Scan on campaigns campaigns_10 (cost=0.00..1.29 rows=29 width=4) (actual time=0.013..0.017 rows=29 loops=1)

505. 0.017 181.636 ↓ 31.0 31 1

Hash (cost=12,176.63..12,176.63 rows=1 width=16) (actual time=181.636..181.636 rows=31 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
506. 0.013 181.619 ↓ 31.0 31 1

Subquery Scan on boosted (cost=12,176.61..12,176.63 rows=1 width=16) (actual time=181.555..181.619 rows=31 loops=1)

507. 0.043 181.606 ↓ 31.0 31 1

Unique (cost=12,176.61..12,176.62 rows=1 width=16) (actual time=181.554..181.606 rows=31 loops=1)

508. 0.452 181.563 ↓ 207.0 207 1

Sort (cost=12,176.61..12,176.62 rows=1 width=16) (actual time=181.552..181.563 rows=207 loops=1)

  • Sort Key: reports2_8.yt_video_id, cs_15.id
  • Sort Method: quicksort Memory: 34kB
509. 15.004 181.111 ↓ 207.0 207 1

Gather (cost=7,776.48..12,176.60 rows=1 width=16) (actual time=180.415..181.111 rows=207 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
510. 2.836 166.107 ↓ 104.0 104 2

Hash Join (cost=6,776.48..11,176.50 rows=1 width=16) (actual time=165.786..166.107 rows=104 loops=2)

  • Hash Cond: (((reports2_8.yt_video_id)::text = (reports_3.yt_video_id)::text) AND (reports2_8.google_ad_id = reports_3.google_ad_id) AND (reports2_8.google_ad_group_id = reports_3.google_ad_group_id) AND (reports2_8.fetched_at = (max(reports_3.fetched_at))))
511. 18.997 40.285 ↑ 10.4 6,995 2

Hash Join (cost=1,449.90..5,089.55 rows=72,416 width=72) (actual time=13.058..40.285 rows=6,995 loops=2)

  • Hash Cond: ((reports2_8.google_ad_id = google_ads_1.id) AND (reports2_8.google_ad_group_id = google_ads_1.google_ad_group_id))
512. 8.366 8.366 ↑ 1.2 61,554 2

Parallel Seq Scan on google_ads_video_performance_reports reports2_8 (cost=0.00..3,096.16 rows=72,416 width=36) (actual time=0.011..8.366 rows=61,554 loops=2)

513. 0.233 12.922 ↑ 68.6 408 2

Hash (cost=1,029.95..1,029.95 rows=27,997 width=36) (actual time=12.922..12.922 rows=408 loops=2)

  • Buckets: 32768 Batches: 1 Memory Usage: 284kB
514. 0.158 12.689 ↑ 68.6 408 2

Hash Join (cost=141.66..1,029.95 rows=27,997 width=36) (actual time=3.533..12.689 rows=408 loops=2)

  • Hash Cond: (google_ad_groups_1.google_campaign_id = google_campaigns_1.id)
515. 0.211 12.359 ↑ 68.6 408 2

Hash Join (cost=131.43..945.10 rows=27,997 width=44) (actual time=3.348..12.359 rows=408 loops=2)

  • Hash Cond: (google_ads_1.google_ad_group_id = google_ad_groups_1.id)
516. 4.746 11.231 ↑ 68.6 408 2

Hash Join (cost=79.89..819.88 rows=27,997 width=28) (actual time=2.412..11.231 rows=408 loops=2)

  • Hash Cond: (google_ads_1.google_ad_group_id = google_ad_groups_1_1.id)
517. 4.114 4.114 ↑ 1.0 27,997 2

Seq Scan on google_ads google_ads_1 (cost=0.00..633.97 rows=27,997 width=16) (actual time=0.024..4.114 rows=27,997 loops=2)

518. 0.063 2.371 ↓ 31.5 189 2

Hash (cost=79.82..79.82 rows=6 width=12) (actual time=2.371..2.371 rows=189 loops=2)

  • Buckets: 1024 Batches: 1 Memory Usage: 17kB
519. 0.180 2.308 ↓ 31.5 189 2

Hash Join (cost=55.57..79.82 rows=6 width=12) (actual time=1.800..2.308 rows=189 loops=2)

  • Hash Cond: (google_campaigns_1_1.campaign_id = cs_15.id)
520. 1.120 2.096 ↑ 1.0 1,624 2

HashAggregate (cost=53.92..70.16 rows=1,624 width=12) (actual time=1.747..2.096 rows=1,624 loops=2)

  • Group Key: google_campaigns_1_1.campaign_id, google_ad_groups_1_1.id
521. 0.628 0.976 ↑ 1.0 1,624 2

Hash Join (cost=10.23..45.80 rows=1,624 width=12) (actual time=0.169..0.976 rows=1,624 loops=2)

  • Hash Cond: (google_ad_groups_1_1.google_campaign_id = google_campaigns_1_1.id)
522. 0.202 0.202 ↑ 1.0 1,624 2

Seq Scan on google_ad_groups google_ad_groups_1_1 (cost=0.00..31.24 rows=1,624 width=16) (actual time=0.007..0.202 rows=1,624 loops=2)

523. 0.073 0.146 ↑ 1.0 277 2

Hash (cost=6.77..6.77 rows=277 width=12) (actual time=0.146..0.146 rows=277 loops=2)

  • Buckets: 1024 Batches: 1 Memory Usage: 19kB
524. 0.073 0.073 ↑ 1.0 277 2

Seq Scan on google_campaigns google_campaigns_1_1 (cost=0.00..6.77 rows=277 width=12) (actual time=0.007..0.073 rows=277 loops=2)

525. 0.010 0.032 ↑ 1.0 29 2

Hash (cost=1.29..1.29 rows=29 width=4) (actual time=0.032..0.032 rows=29 loops=2)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
526. 0.022 0.022 ↑ 1.0 29 2

Seq Scan on campaigns cs_15 (cost=0.00..1.29 rows=29 width=4) (actual time=0.016..0.022 rows=29 loops=2)

527. 0.467 0.917 ↑ 1.0 1,624 2

Hash (cost=31.24..31.24 rows=1,624 width=16) (actual time=0.917..0.917 rows=1,624 loops=2)

  • Buckets: 2048 Batches: 1 Memory Usage: 93kB
528. 0.450 0.450 ↑ 1.0 1,624 2

Seq Scan on google_ad_groups google_ad_groups_1 (cost=0.00..31.24 rows=1,624 width=16) (actual time=0.019..0.450 rows=1,624 loops=2)

529. 0.066 0.172 ↑ 1.0 277 2

Hash (cost=6.77..6.77 rows=277 width=8) (actual time=0.172..0.172 rows=277 loops=2)

  • Buckets: 1024 Batches: 1 Memory Usage: 19kB
530. 0.106 0.106 ↑ 1.0 277 2

Seq Scan on google_campaigns google_campaigns_1 (cost=0.00..6.77 rows=277 width=8) (actual time=0.033..0.106 rows=277 loops=2)

531. 0.960 122.986 ↑ 7.0 1,770 2

Hash (cost=5,080.36..5,080.36 rows=12,311 width=36) (actual time=122.986..122.986 rows=1,770 loops=2)

  • Buckets: 16384 Batches: 1 Memory Usage: 253kB
532. 99.581 122.026 ↑ 7.0 1,770 2

HashAggregate (cost=4,834.14..4,957.25 rows=12,311 width=36) (actual time=121.388..122.026 rows=1,770 loops=2)

  • Group Key: reports_3.google_ad_id, reports_3.google_ad_group_id, reports_3.yt_video_id
533. 22.445 22.445 ↑ 1.0 123,107 2

Seq Scan on google_ads_video_performance_reports reports_3 (cost=0.00..3,603.07 rows=123,107 width=36) (actual time=0.028..22.445 rows=123,107 loops=2)

534. 0.023 185.262 ↓ 31.0 31 1

Hash (cost=12,482.75..12,482.75 rows=1 width=40) (actual time=185.262..185.262 rows=31 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
535. 0.004 185.239 ↓ 31.0 31 1

Subquery Scan on g_ads_video_ov (cost=12,482.58..12,482.75 rows=1 width=40) (actual time=184.405..185.239 rows=31 loops=1)

536. 0.857 185.235 ↓ 31.0 31 1

GroupAggregate (cost=12,482.58..12,482.74 rows=1 width=80) (actual time=184.403..185.235 rows=31 loops=1)

  • Group Key: reports2_9.yt_video_id
537. 0.438 184.378 ↓ 207.0 207 1

Sort (cost=12,482.58..12,482.58 rows=1 width=100) (actual time=184.365..184.378 rows=207 loops=1)

  • Sort Key: reports2_9.yt_video_id
  • Sort Method: quicksort Memory: 67kB
538. 15.020 183.940 ↓ 207.0 207 1

Gather (cost=7,891.78..12,482.57 rows=1 width=100) (actual time=183.297..183.940 rows=207 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
539. 2.765 168.920 ↓ 104.0 104 2

Hash Join (cost=6,891.78..11,482.47 rows=1 width=100) (actual time=168.613..168.920 rows=104 loops=2)

  • Hash Cond: (((reports2_9.yt_video_id)::text = (reports_4.yt_video_id)::text) AND (reports2_9.google_ad_id = reports_4.google_ad_id) AND (reports2_9.google_ad_group_id = reports_4.google_ad_group_id) AND (reports2_9.fetched_at = (max(reports_4.fetched_at))))
540. 3.594 45.443 ↑ 10.4 6,995 2

Hash Left Join (cost=1,565.20..5,395.52 rows=72,416 width=148) (actual time=14.277..45.443 rows=6,995 loops=2)

  • Hash Cond: ((reports2_9.yt_video_id)::text = (yt_videos_1.id)::text)
541. 19.332 40.726 ↑ 10.4 6,995 2

Hash Join (cost=1,449.90..5,089.55 rows=72,416 width=144) (actual time=13.127..40.726 rows=6,995 loops=2)

  • Hash Cond: ((reports2_9.google_ad_id = google_ads_2.id) AND (reports2_9.google_ad_group_id = google_ads_2.google_ad_group_id))
542. 8.460 8.460 ↑ 1.2 61,554 2

Parallel Seq Scan on google_ads_video_performance_reports reports2_9 (cost=0.00..3,096.16 rows=72,416 width=64) (actual time=0.013..8.460 rows=61,554 loops=2)

543. 0.266 12.934 ↑ 68.6 408 2

Hash (cost=1,029.95..1,029.95 rows=27,997 width=80) (actual time=12.934..12.934 rows=408 loops=2)

  • Buckets: 32768 Batches: 1 Memory Usage: 306kB
544. 0.170 12.668 ↑ 68.6 408 2

Hash Join (cost=141.66..1,029.95 rows=27,997 width=80) (actual time=3.591..12.668 rows=408 loops=2)

  • Hash Cond: (google_ad_groups_2.google_campaign_id = google_campaigns_2.id)
545. 0.191 12.266 ↑ 68.6 408 2

Hash Join (cost=131.43..945.10 rows=27,997 width=44) (actual time=3.336..12.266 rows=408 loops=2)

  • Hash Cond: (google_ads_2.google_ad_group_id = google_ad_groups_2.id)
546. 4.750 11.190 ↑ 68.6 408 2

Hash Join (cost=79.89..819.88 rows=27,997 width=28) (actual time=2.432..11.190 rows=408 loops=2)

  • Hash Cond: (google_ads_2.google_ad_group_id = google_ad_groups_1_2.id)
547. 4.041 4.041 ↑ 1.0 27,997 2

Seq Scan on google_ads google_ads_2 (cost=0.00..633.97 rows=27,997 width=16) (actual time=0.018..4.041 rows=27,997 loops=2)

548. 0.070 2.399 ↓ 31.5 189 2

Hash (cost=79.82..79.82 rows=6 width=12) (actual time=2.399..2.399 rows=189 loops=2)

  • Buckets: 1024 Batches: 1 Memory Usage: 17kB
549. 0.180 2.329 ↓ 31.5 189 2

Hash Join (cost=55.57..79.82 rows=6 width=12) (actual time=1.789..2.329 rows=189 loops=2)

  • Hash Cond: (google_campaigns_1_2.campaign_id = cs_16.id)
550. 1.144 2.119 ↑ 1.0 1,624 2

HashAggregate (cost=53.92..70.16 rows=1,624 width=12) (actual time=1.738..2.119 rows=1,624 loops=2)

  • Group Key: google_campaigns_1_2.campaign_id, google_ad_groups_1_2.id
551. 0.637 0.975 ↑ 1.0 1,624 2

Hash Join (cost=10.23..45.80 rows=1,624 width=12) (actual time=0.168..0.975 rows=1,624 loops=2)

  • Hash Cond: (google_ad_groups_1_2.google_campaign_id = google_campaigns_1_2.id)
552. 0.191 0.191 ↑ 1.0 1,624 2

Seq Scan on google_ad_groups google_ad_groups_1_2 (cost=0.00..31.24 rows=1,624 width=16) (actual time=0.006..0.191 rows=1,624 loops=2)

553. 0.075 0.147 ↑ 1.0 277 2

Hash (cost=6.77..6.77 rows=277 width=12) (actual time=0.147..0.147 rows=277 loops=2)

  • Buckets: 1024 Batches: 1 Memory Usage: 19kB
554. 0.072 0.072 ↑ 1.0 277 2

Seq Scan on google_campaigns google_campaigns_1_2 (cost=0.00..6.77 rows=277 width=12) (actual time=0.006..0.072 rows=277 loops=2)

555. 0.008 0.030 ↑ 1.0 29 2

Hash (cost=1.29..1.29 rows=29 width=4) (actual time=0.030..0.030 rows=29 loops=2)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
556. 0.022 0.022 ↑ 1.0 29 2

Seq Scan on campaigns cs_16 (cost=0.00..1.29 rows=29 width=4) (actual time=0.015..0.022 rows=29 loops=2)

557. 0.471 0.885 ↑ 1.0 1,624 2

Hash (cost=31.24..31.24 rows=1,624 width=16) (actual time=0.885..0.885 rows=1,624 loops=2)

  • Buckets: 2048 Batches: 1 Memory Usage: 93kB
558. 0.414 0.414 ↑ 1.0 1,624 2

Seq Scan on google_ad_groups google_ad_groups_2 (cost=0.00..31.24 rows=1,624 width=16) (actual time=0.022..0.414 rows=1,624 loops=2)

559. 0.098 0.232 ↑ 1.0 277 2

Hash (cost=6.77..6.77 rows=277 width=52) (actual time=0.232..0.232 rows=277 loops=2)

  • Buckets: 1024 Batches: 1 Memory Usage: 32kB
560. 0.134 0.134 ↑ 1.0 277 2

Seq Scan on google_campaigns google_campaigns_2 (cost=0.00..6.77 rows=277 width=52) (actual time=0.068..0.134 rows=277 loops=2)

561. 0.414 1.123 ↑ 1.0 1,391 2

Hash (cost=97.91..97.91 rows=1,391 width=16) (actual time=1.123..1.123 rows=1,391 loops=2)

  • Buckets: 2048 Batches: 1 Memory Usage: 82kB
562. 0.709 0.709 ↑ 1.0 1,391 2

Seq Scan on yt_videos yt_videos_1 (cost=0.00..97.91 rows=1,391 width=16) (actual time=0.037..0.709 rows=1,391 loops=2)

563. 1.018 120.712 ↑ 7.0 1,770 2

Hash (cost=5,080.36..5,080.36 rows=12,311 width=36) (actual time=120.712..120.712 rows=1,770 loops=2)

  • Buckets: 16384 Batches: 1 Memory Usage: 253kB
564. 97.616 119.694 ↑ 7.0 1,770 2

HashAggregate (cost=4,834.14..4,957.25 rows=12,311 width=36) (actual time=119.050..119.694 rows=1,770 loops=2)

  • Group Key: reports_4.google_ad_id, reports_4.google_ad_group_id, reports_4.yt_video_id
565. 22.078 22.078 ↑ 1.0 123,107 2

Seq Scan on google_ads_video_performance_reports reports_4 (cost=0.00..3,603.07 rows=123,107 width=36) (actual time=0.017..22.078 rows=123,107 loops=2)

566. 0.093 0.122 ↓ 23.0 23 1

Sort (cost=1.30..1.30 rows=1 width=564) (actual time=0.118..0.122 rows=23 loops=1)

  • Sort Key: yt_stats.yt_video_id
  • Sort Method: quicksort Memory: 28kB
567. 0.029 0.029 ↓ 29.0 29 1

Seq Scan on yt_analytics_basic_stats yt_stats (cost=0.00..1.29 rows=1 width=564) (actual time=0.012..0.029 rows=29 loops=1)

  • Filter: (country IS NULL)
568. 0.074 0.253 ↑ 1.0 22 1

Sort (cost=7.65..7.70 rows=22 width=44) (actual time=0.253..0.253 rows=22 loops=1)

  • Sort Key: global_traffic_views.yt_video_id
  • Sort Method: quicksort Memory: 26kB
569. 0.005 0.179 ↑ 1.0 22 1

Subquery Scan on global_traffic_views (cost=6.66..7.16 rows=22 width=44) (actual time=0.163..0.179 rows=22 loops=1)

570. 0.126 0.174 ↑ 1.0 22 1

HashAggregate (cost=6.66..6.94 rows=22 width=232) (actual time=0.162..0.174 rows=22 loops=1)

  • Group Key: t_reports.yt_channel_id, t_reports.yt_video_id, t_reports.country
571. 0.048 0.048 ↑ 1.0 153 1

Seq Scan on yt_analytics_traffic_source t_reports (cost=0.00..4.75 rows=153 width=59) (actual time=0.008..0.048 rows=153 loops=1)

  • Filter: (country IS NULL)
  • Rows Removed by Filter: 22
572. 0.023 0.088 ↑ 2.0 7 1

Sort (cost=6.04..6.08 rows=14 width=44) (actual time=0.088..0.088 rows=7 loops=1)

  • Sort Key: au_traffic_views.yt_video_id
  • Sort Method: quicksort Memory: 25kB
573. 0.003 0.065 ↑ 2.0 7 1

Subquery Scan on au_traffic_views (cost=5.46..5.78 rows=14 width=44) (actual time=0.056..0.065 rows=7 loops=1)

574. 0.031 0.062 ↑ 2.0 7 1

HashAggregate (cost=5.46..5.64 rows=14 width=232) (actual time=0.054..0.062 rows=7 loops=1)

  • Group Key: t_reports_1.yt_channel_id, t_reports_1.yt_video_id, t_reports_1.country
575. 0.031 0.031 ↑ 1.0 22 1

Seq Scan on yt_analytics_traffic_source t_reports_1 (cost=0.00..5.19 rows=22 width=59) (actual time=0.017..0.031 rows=22 loops=1)

  • Filter: (country = 'AU'::bpchar)
  • Rows Removed by Filter: 153
576. 0.012 0.033 ↑ 1.3 22 1

Hash (cost=1.29..1.29 rows=29 width=524) (actual time=0.033..0.033 rows=22 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
577. 0.021 0.021 ↑ 1.0 29 1

Seq Scan on yt_analytics_basic_stats yt_stats_1 (cost=0.00..1.29 rows=29 width=524) (actual time=0.006..0.021 rows=29 loops=1)

578. 0.008 0.650 ↑ 2.0 3 1

Materialize (cost=22.09..22.81 rows=6 width=84) (actual time=0.638..0.650 rows=3 loops=1)

579. 0.027 0.642 ↑ 2.0 3 1

GroupAggregate (cost=22.09..22.73 rows=6 width=120) (actual time=0.632..0.642 rows=3 loops=1)

  • Group Key: cs_17.id, ext_posts_5.platform
580. 0.014 0.615 ↑ 1.0 6 1

Sort (cost=22.09..22.10 rows=6 width=96) (actual time=0.615..0.615 rows=6 loops=1)

  • Sort Key: cs_17.id
  • Sort Method: quicksort Memory: 25kB
581. 0.043 0.601 ↑ 1.0 6 1

Hash Right Join (cost=16.75..22.01 rows=6 width=96) (actual time=0.383..0.601 rows=6 loops=1)

  • Hash Cond: (links_8.url = ext_posts_5.url)
582. 0.091 0.458 ↑ 1.0 73 1

Hash Left Join (cost=9.65..14.58 rows=73 width=141) (actual time=0.257..0.458 rows=73 loops=1)

  • Hash Cond: ((links_8.distributor_id = distributors_stats_2.distributor_id) AND (campaigns_12.id = distributors_stats_2.campaign_id) AND (links_8.platform = distributors_stats_2.platform))
583. 0.053 0.347 ↑ 1.0 73 1

Hash Left Join (cost=8.13..11.57 rows=73 width=157) (actual time=0.213..0.347 rows=73 loops=1)

  • Hash Cond: (creatives_16.campaign_id = campaigns_12.id)
584. 0.042 0.276 ↑ 1.0 73 1

Hash Left Join (cost=6.48..9.70 rows=73 width=157) (actual time=0.183..0.276 rows=73 loops=1)

  • Hash Cond: (links_8.creative_id = creatives_16.id)
585. 0.068 0.196 ↑ 1.0 73 1

Hash Left Join (cost=3.90..6.92 rows=73 width=157) (actual time=0.130..0.196 rows=73 loops=1)

  • Hash Cond: (links_8.url = reports3_6.ext_post_url)
586. 0.015 0.015 ↑ 1.0 73 1

Seq Scan on campaign_social_links links_8 (cost=0.00..2.73 rows=73 width=65) (actual time=0.004..0.015 rows=73 loops=1)

587. 0.023 0.113 ↓ 21.0 21 1

Hash (cost=3.89..3.89 rows=1 width=124) (actual time=0.113..0.113 rows=21 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
588. 0.037 0.090 ↓ 21.0 21 1

Hash Join (cost=2.45..3.89 rows=1 width=124) (actual time=0.063..0.090 rows=21 loops=1)

  • Hash Cond: ((reports3_6.reported_at = wlatest_9.latest_report) AND (reports3_6.ext_post_url = wlatest_9.ext_post_url))
589. 0.007 0.007 ↑ 1.0 29 1

Seq Scan on ext_posts_reports reports3_6 (cost=0.00..1.29 rows=29 width=132) (actual time=0.003..0.007 rows=29 loops=1)

590. 0.012 0.046 ↑ 1.4 21 1

Hash (cost=2.02..2.02 rows=29 width=40) (actual time=0.046..0.046 rows=21 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
591. 0.003 0.034 ↑ 1.4 21 1

Subquery Scan on wlatest_9 (cost=1.44..2.02 rows=29 width=40) (actual time=0.025..0.034 rows=21 loops=1)

592. 0.024 0.031 ↑ 1.4 21 1

HashAggregate (cost=1.44..1.73 rows=29 width=40) (actual time=0.025..0.031 rows=21 loops=1)

  • Group Key: reports2_10.ext_post_url
593. 0.007 0.007 ↑ 1.0 29 1

Seq Scan on ext_posts_reports reports2_10 (cost=0.00..1.29 rows=29 width=40) (actual time=0.003..0.007 rows=29 loops=1)

594. 0.021 0.038 ↑ 1.0 70 1

Hash (cost=1.70..1.70 rows=70 width=8) (actual time=0.038..0.038 rows=70 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
595. 0.017 0.017 ↑ 1.0 70 1

Seq Scan on creatives creatives_16 (cost=0.00..1.70 rows=70 width=8) (actual time=0.005..0.017 rows=70 loops=1)

596. 0.010 0.018 ↑ 1.0 29 1

Hash (cost=1.29..1.29 rows=29 width=4) (actual time=0.018..0.018 rows=29 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
597. 0.008 0.008 ↑ 1.0 29 1

Seq Scan on campaigns campaigns_12 (cost=0.00..1.29 rows=29 width=4) (actual time=0.004..0.008 rows=29 loops=1)

598. 0.009 0.020 ↑ 1.0 19 1

Hash (cost=1.19..1.19 rows=19 width=16) (actual time=0.020..0.020 rows=19 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
599. 0.011 0.011 ↑ 1.0 19 1

Seq Scan on distributors_stats distributors_stats_2 (cost=0.00..1.19 rows=19 width=16) (actual time=0.005..0.011 rows=19 loops=1)

600. 0.007 0.100 ↑ 1.0 6 1

Hash (cost=7.02..7.02 rows=6 width=61) (actual time=0.100..0.100 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
601. 0.017 0.093 ↑ 1.0 6 1

Hash Join (cost=5.52..7.02 rows=6 width=61) (actual time=0.089..0.093 rows=6 loops=1)

  • Hash Cond: (cs_17.id = creatives_15.campaign_id)
602. 0.008 0.008 ↑ 1.0 29 1

Seq Scan on campaigns cs_17 (cost=0.00..1.29 rows=29 width=4) (actual time=0.005..0.008 rows=29 loops=1)

603. 0.010 0.068 ↑ 1.0 6 1

Hash (cost=5.45..5.45 rows=6 width=61) (actual time=0.068..0.068 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
604. 0.025 0.058 ↑ 1.0 6 1

Hash Join (cost=2.99..5.45 rows=6 width=61) (actual time=0.047..0.058 rows=6 loops=1)

  • Hash Cond: (creatives_15.id = ext_posts_5.creative_id)
605. 0.009 0.009 ↑ 1.0 70 1

Seq Scan on creatives creatives_15 (cost=0.00..1.70 rows=70 width=8) (actual time=0.005..0.009 rows=70 loops=1)

606. 0.007 0.024 ↑ 1.0 6 1

Hash (cost=2.91..2.91 rows=6 width=61) (actual time=0.024..0.024 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
607. 0.017 0.017 ↑ 1.0 6 1

Seq Scan on campaign_social_links ext_posts_5 (cost=0.00..2.91 rows=6 width=61) (actual time=0.006..0.017 rows=6 loops=1)

  • Filter: (platform = 'twitter'::social_platforms_single)
  • Rows Removed by Filter: 67