Skip to content

Commit

Permalink
Tidy up 2019 sql (#1288)
Browse files Browse the repository at this point in the history
* COUNT(0) and newlines

* Add date columns to dated Almanac tables
  • Loading branch information
tunetheweb authored and sudheendrachari committed Sep 15, 2020
1 parent 3ee1ed8 commit 2f64d72
Show file tree
Hide file tree
Showing 403 changed files with 795 additions and 458 deletions.
2 changes: 1 addition & 1 deletion sql/2019/01_JavaScript/01_01a.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ FROM
GROUP BY
percentile
ORDER BY
percentile
percentile
2 changes: 1 addition & 1 deletion sql/2019/01_JavaScript/01_01b.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ GROUP BY
client
ORDER BY
percentile,
client
client
6 changes: 4 additions & 2 deletions sql/2019/01_JavaScript/01_02a.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ FROM (
respSize,
NET.HOST(url) IN (SELECT domain FROM `httparchive.almanac.third_parties`) AS is_third_party
FROM
`httparchive.almanac.summary_requests`)
`httparchive.almanac.summary_requests`
WHERE
date = '2019-07-01')
WHERE
type = 'script'
GROUP BY
Expand All @@ -25,4 +27,4 @@ FROM (
GROUP BY
percentile
ORDER BY
percentile
percentile
3 changes: 2 additions & 1 deletion sql/2019/01_JavaScript/01_02b.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ FROM (
FROM
`httparchive.almanac.summary_requests`
WHERE
date = '2019-07-01' AND
type = 'script'
GROUP BY
client,
Expand All @@ -23,4 +24,4 @@ GROUP BY
client
ORDER BY
percentile,
client
client
1 change: 1 addition & 0 deletions sql/2019/01_JavaScript/01_04.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ FROM (
FROM
`httparchive.almanac.summary_requests`
WHERE
date = '2019-07-01' AND
type = 'script'
GROUP BY
client,
Expand Down
2 changes: 1 addition & 1 deletion sql/2019/01_JavaScript/01_05.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ FROM
WHERE
type = 'script'
GROUP BY
client
client
2 changes: 1 addition & 1 deletion sql/2019/01_JavaScript/01_06.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ FROM
WHERE
type = 'script'
GROUP BY
client
client
2 changes: 1 addition & 1 deletion sql/2019/01_JavaScript/01_07.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ SELECT
FROM (
SELECT _TABLE_SUFFIX AS client, totalMainThreadTime(payload) AS v8_time FROM `httparchive.pages.2019_07_01_*`)
GROUP BY
client
client
2 changes: 1 addition & 1 deletion sql/2019/01_JavaScript/01_08.sql
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ GROUP BY
client,
total
ORDER BY
freq DESC
freq DESC
2 changes: 1 addition & 1 deletion sql/2019/01_JavaScript/01_09.sql
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ USING (app, client)
WHERE
freq_2019 > 10
ORDER BY
freq_2019 DESC
freq_2019 DESC
2 changes: 1 addition & 1 deletion sql/2019/01_JavaScript/01_10.sql
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ GROUP BY
client,
total
ORDER BY
freq DESC
freq DESC
2 changes: 1 addition & 1 deletion sql/2019/01_JavaScript/01_11.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ GROUP BY
app,
client
ORDER BY
freq DESC
freq DESC
2 changes: 1 addition & 1 deletion sql/2019/01_JavaScript/01_12.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ SELECT
FROM
`httparchive.pages.2019_07_01_*`
GROUP BY
client
client
2 changes: 1 addition & 1 deletion sql/2019/01_JavaScript/01_13.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ SELECT
FROM
`httparchive.pages.2019_07_01_*`
GROUP BY
client
client
2 changes: 1 addition & 1 deletion sql/2019/01_JavaScript/01_14.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ SELECT
FROM
`httparchive.pages.2019_07_01_*`
GROUP BY
client
client
2 changes: 1 addition & 1 deletion sql/2019/01_JavaScript/01_15.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ SELECT
FROM
`httparchive.pages.2019_07_01_*`
GROUP BY
client
client
2 changes: 1 addition & 1 deletion sql/2019/01_JavaScript/01_16.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ SELECT
FROM
`httparchive.pages.2019_07_01_*`
GROUP BY
client
client
3 changes: 2 additions & 1 deletion sql/2019/01_JavaScript/01_18.sql
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ FROM (
FROM
`httparchive.almanac.summary_response_bodies`
WHERE
date = '2019-07-01' AND
type = 'script'
GROUP BY
client,
page)
GROUP BY
client
ORDER BY
client
client
3 changes: 2 additions & 1 deletion sql/2019/01_JavaScript/01_24.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ JOIN
USING
(client)
WHERE
date = '2019-07-01' AND
type = 'script' AND
body LIKE '%import(%' AND
NET.REG_DOMAIN(page) = NET.REG_DOMAIN(url)
GROUP BY
client,
total
total
3 changes: 2 additions & 1 deletion sql/2019/01_JavaScript/01_25.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ JOIN
USING
(client)
WHERE
date = '2019-07-01' AND
type = 'script' AND
body LIKE '%sourceMappingURL%' AND
NET.REG_DOMAIN(page) = NET.REG_DOMAIN(url)
GROUP BY
client,
total
total
4 changes: 3 additions & 1 deletion sql/2019/02_CSS/02_01.sql
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ FROM (
COUNTIF(usesCustomProps(css)) AS num_stylesheets
FROM
`httparchive.almanac.parsed_css`
WHERE
date = '2019-07-01'
GROUP BY
client,
page)
Expand All @@ -41,4 +43,4 @@ USING
(client)
GROUP BY
client,
total
total
2 changes: 1 addition & 1 deletion sql/2019/02_CSS/02_02.sql
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ USING
(client)
GROUP BY
client,
total
total
4 changes: 3 additions & 1 deletion sql/2019/02_CSS/02_03.sql
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ FROM (
COUNTIF(usesFilterProp(css)) AS num_stylesheets
FROM
`httparchive.almanac.parsed_css`
WHERE
date = '2019-07-01'
GROUP BY
client,
page)
Expand All @@ -41,4 +43,4 @@ USING
(client)
GROUP BY
client,
total
total
4 changes: 3 additions & 1 deletion sql/2019/02_CSS/02_04.sql
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ FROM (
COUNTIF(usesBlendModes(css)) AS num_stylesheets
FROM
`httparchive.almanac.parsed_css`
WHERE
date = '2019-07-01'
GROUP BY
client,
page)
Expand All @@ -41,4 +43,4 @@ USING
(client)
GROUP BY
client,
total
total
2 changes: 2 additions & 0 deletions sql/2019/02_CSS/02_04b.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ SELECT
FROM
`httparchive.almanac.parsed_css`,
UNNEST(getBlendModes(css)) AS blend_mode
WHERE
date = '2019-07-01'
GROUP BY
client,
blend_mode
Expand Down
4 changes: 3 additions & 1 deletion sql/2019/02_CSS/02_05.sql
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ FROM (
COUNTIF(usesLogicalProps(css)) AS num_stylesheets
FROM
`httparchive.almanac.parsed_css`
WHERE
date = '2019-07-01'
GROUP BY
client,
page)
Expand All @@ -51,4 +53,4 @@ USING
(client)
GROUP BY
client,
total
total
6 changes: 4 additions & 2 deletions sql/2019/02_CSS/02_06.sql
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ FROM (
page,
getColorFormats(css) AS color
FROM
`httparchive.almanac.parsed_css`)
`httparchive.almanac.parsed_css`
WHERE
date = '2019-07-01')
GROUP BY
client,
page)
Expand All @@ -83,4 +85,4 @@ USING
(client)
GROUP BY
client,
total
total
2 changes: 2 additions & 0 deletions sql/2019/02_CSS/02_06b.sql
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ SELECT
FROM
`httparchive.almanac.parsed_css`,
UNNEST(getColors(css)) AS color
WHERE
date = '2019-07-01'
GROUP BY
client,
color
Expand Down
4 changes: 3 additions & 1 deletion sql/2019/02_CSS/02_07.sql
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ FROM (
FROM
`httparchive.almanac.parsed_css`,
UNNEST(getLengthUnit(css)) AS unit
WHERE
date = '2019-07-01'
GROUP BY
client,
unit)
Expand All @@ -65,4 +67,4 @@ JOIN
USING
(client)
ORDER BY
freq / total DESC
freq / total DESC
6 changes: 4 additions & 2 deletions sql/2019/02_CSS/02_08.sql
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ FROM (
page,
getSelectorType(css) AS type
FROM
`httparchive.almanac.parsed_css`)
`httparchive.almanac.parsed_css`
WHERE
date = '2019-07-01')
GROUP BY
client,
page)
Expand All @@ -57,4 +59,4 @@ USING
(client)
GROUP BY
client,
total
total
6 changes: 4 additions & 2 deletions sql/2019/02_CSS/02_08b.sql
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ FROM (
client,
getSelectorType(css) AS type
FROM
`httparchive.almanac.parsed_css`)
`httparchive.almanac.parsed_css`
WHERE
date = '2019-07-01')
GROUP BY
client
client
2 changes: 1 addition & 1 deletion sql/2019/02_CSS/02_10.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ GROUP BY
total,
library
ORDER BY
freq / total DESC
freq / total DESC
4 changes: 2 additions & 2 deletions sql/2019/02_CSS/02_11.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SELECT
total,
ROUND(COUNT(DISTINCT page) * 100 / total, 2) AS pct
FROM
(SELECT client, page, body FROM `httparchive.almanac.summary_response_bodies` WHERE type = 'css')
(SELECT client, page, body FROM `httparchive.almanac.summary_response_bodies` WHERE date = '2019-07-01' AND type = 'css')
JOIN
(SELECT _TABLE_SUFFIX AS client, COUNT(0) AS total FROM `httparchive.summary_pages.2019_07_01_*` GROUP BY client)
USING (client),
Expand All @@ -23,4 +23,4 @@ GROUP BY
total,
util
ORDER BY
freq / total DESC
freq / total DESC
4 changes: 3 additions & 1 deletion sql/2019/02_CSS/02_12.sql
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ FROM (
FROM
`httparchive.almanac.parsed_css`,
UNNEST(getDirValues(css)) AS direction
WHERE
date = '2019-07-01'
GROUP BY
client,
direction)
Expand All @@ -53,4 +55,4 @@ JOIN
USING
(client)
ORDER BY
freq / total DESC
freq / total DESC
2 changes: 1 addition & 1 deletion sql/2019/02_CSS/02_13.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ WHERE
GROUP BY
client,
feature,
total
total
2 changes: 1 addition & 1 deletion sql/2019/02_CSS/02_14.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ WHERE
GROUP BY
client,
feature,
total
total
Loading

0 comments on commit 2f64d72

Please sign in to comment.