Filter out overactive clients in search clients daily (#511)

This commit is contained in:
Ben Wu 2019-11-18 20:57:31 -05:00 коммит произвёл GitHub
Родитель c0160496d4
Коммит 10e300465b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 38 добавлений и 0 удалений

Просмотреть файл

@ -31,6 +31,19 @@ CREATE TEMP FUNCTION get_search_addon_version(active_addons ANY type) AS (
);
WITH
overactive AS (
-- find client_ids with over 200,000 pings in a day
SELECT
client_id
FROM
telemetry.main_summary
WHERE
submission_date = @submission_date
GROUP BY
client_id
HAVING
COUNT(*) > 200000
),
augmented AS (
SELECT
*,
@ -80,6 +93,12 @@ WITH
SUM(scalar_parent_browser_engagement_total_uri_count) OVER w1 AS total_uri_count
FROM
telemetry.main_summary
LEFT JOIN
overactive
USING
(client_id)
WHERE
overactive.client_id IS NULL
WINDOW
w1 AS (
PARTITION BY

Просмотреть файл

@ -13,6 +13,19 @@ CREATE TEMP FUNCTION get_search_addon_version(active_addons ANY type) AS (
);
WITH
overactive AS (
-- find client_ids with over 200,000 pings in a day
SELECT
client_id
FROM
telemetry.main_summary
WHERE
submission_date = @submission_date
GROUP BY
client_id
HAVING
COUNT(*) > 200000
),
augmented AS (
SELECT
*,
@ -62,6 +75,12 @@ WITH
SUM(scalar_parent_browser_engagement_total_uri_count) OVER w1 AS total_uri_count
FROM
telemetry.main_summary
LEFT JOIN
overactive
USING
(client_id)
WHERE
overactive.client_id IS NULL
WINDOW
w1 AS (
PARTITION BY