r90633 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90632‎ | r90633 | r90634 >
Date:23:30, 22 June 2011
Author:rfaulk
Status:deferred
Tags:
Comment:
pull banner and lp data by time. updated to use new Fundraiser db tables
Modified paths:
  • /trunk/fundraiser-statistics/fundraiser-scripts/sql/report_LP_metrics_minutely.sql (modified) (history)
  • /trunk/fundraiser-statistics/fundraiser-scripts/sql/report_banner_metrics_minutely.sql (modified) (history)

Diff [purge]

Index: trunk/fundraiser-statistics/fundraiser-scripts/sql/report_LP_metrics_minutely.sql
@@ -18,9 +18,10 @@
1919 DATE_FORMAT(request_time,'%sY%sm%sd%sH') as dt_hr,
2020 FLOOR(MINUTE(request_time) / %s) * %s as dt_min,
2121 landing_page,
22 -count(*) as views
 22+count(*) as views,
 23+utm_campaign
2324
24 -from landing_page
 25+from landing_page_requests
2526
2627 where request_time >= '%s' and request_time < '%s'
2728 and utm_campaign REGEXP '%s'
@@ -45,6 +46,7 @@
4647
4748 on ecomm.landing_page = lp.landing_page and ecomm.hr = lp.dt_hr and ecomm.dt_min = lp.dt_min
4849
 50+where lp.utm_campaign REGEXP '%s'
4951 group by 1,2
5052 -- having views > 1000 and donations > 10
5153 order by 1 asc;
Index: trunk/fundraiser-statistics/fundraiser-scripts/sql/report_banner_metrics_minutely.sql
@@ -3,7 +3,7 @@
44 select
55
66 if(imp.dt_min < 10, concat(imp.dt_hr, '0', imp.dt_min,'00'), concat(imp.dt_hr, imp.dt_min,'00')) as day_hr,
7 -lp.utm_source,
 7+imp.utm_source,
88 floor(impressions * (views / total_views)) as impressions,
99 views,
1010 -- total_clicks,
@@ -23,7 +23,7 @@
2424 FLOOR(MINUTE(on_minute) / %s) * %s as dt_min,
2525 utm_source,
2626 sum(counts) as impressions
27 -from impression
 27+from banner_impressions
2828 where on_minute > '%s' and on_minute < '%s'
2929 group by 1,2,3) as imp
3030
@@ -33,8 +33,9 @@
3434 DATE_FORMAT(request_time,'%sY%sm%sd%sH') as dt_hr,
3535 FLOOR(MINUTE(request_time) / %s) * %s as dt_min,
3636 utm_source,
37 -count(*) as views
38 -from landing_page
 37+count(*) as views,
 38+utm_campaign
 39+from landing_page_requests
3940 where request_time >= '%s' and request_time < '%s'
4041 and utm_campaign REGEXP '%s'
4142 group by 1,2,3) as lp
@@ -48,13 +49,13 @@
4950 FLOOR(MINUTE(request_time) / %s) * %s as dt_min,
5051 utm_source,
5152 count(*) as total_views
52 -from landing_page
 53+from landing_page_requests
5354 where request_time >= '%s' and request_time < '%s'
5455 group by 1,2,3) as lp_tot
5556
5657 on imp.utm_source = lp_tot.utm_source and imp.dt_hr = lp_tot.dt_hr and imp.dt_min = lp_tot.dt_min
5758
58 -join
 59+left join
5960
6061 (select
6162 DATE_FORMAT(receive_date,'%sY%sm%sd%sH') as hr,
@@ -73,6 +74,7 @@
7475
7576 on ecomm.banner = lp.utm_source and ecomm.hr = lp.dt_hr and ecomm.dt_min = lp.dt_min
7677
 78+where lp.utm_campaign REGEXP '%s'
7779 group by 1,2
7880 -- having impressions > 100000 and donations > 10
7981 order by 1 asc;

Status & tagging log