-
-
Notifications
You must be signed in to change notification settings - Fork 209
Expand file tree
/
Copy pathranking.sql
More file actions
48 lines (46 loc) · 979 Bytes
/
ranking.sql
File metadata and controls
48 lines (46 loc) · 979 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# WASM usage by page ranking
WITH totals AS (
SELECT
client,
rank_grouping,
COUNT(DISTINCT root_page) AS total_sites
FROM
`httparchive.crawl.requests`,
UNNEST([1000, 10000, 100000, 1000000, 10000000, 100000000]) AS rank_grouping
WHERE
date = '2025-07-01' AND
rank <= rank_grouping
GROUP BY
client,
rank_grouping
ORDER BY
client,
rank_grouping
)
SELECT
client,
rank_grouping,
CASE
WHEN rank_grouping = 100000000 THEN 'all'
ELSE FORMAT("%'d", rank_grouping)
END AS ranking,
COUNT(DISTINCT root_page) AS sites,
total_sites,
COUNT(DISTINCT root_page) / total_sites AS pct_sites
FROM
`httparchive.crawl.requests`,
UNNEST([1000, 10000, 100000, 1000000, 10000000, 100000000]) AS rank_grouping
INNER JOIN
totals
USING (client, rank_grouping)
WHERE
date = '2025-07-01' AND
type = 'wasm' AND
rank <= rank_grouping
GROUP BY
client,
rank_grouping,
total_sites
ORDER BY
client,
rank_grouping