Hi RickThis is very cool. If I understand the query correctly, to get a different percentile, such as the 80th, would I just change ">= 0.5" to ">= 0.8"?Regards,Joe
#standardSQLSELECT MIN(start)FROM ( SELECT start, SUM(pdf) OVER (ORDER BY start) AS cdf FROM ( SELECT start, n / SUM(n) OVER () AS pdf FROM ( SELECT bin.start, SUM(bin.density) AS n FROM `chrome-ux-report.country_in.201903`, UNNEST(onload.histogram.bin) AS bin WHERE form_factor.name = 'phone' GROUP BY start)))WHERE cdf >= 0.5Hi RickI can't see a way around a problem. I want to determine the median load time for specific devices in specific countries. The query I'm using is set out below, but I get an error message about resource usage. Is there a way around the problem?QUERY:#standardSQL
SELECT
MIN(start) AS Load
FROM (
SELECT
bin.start,
SUM(bin.density) OVER (ORDER BY bin.start) AS cdf
FROM
`chrome-ux-report.country_in.201903`,
UNNEST(onLoad.histogram.bin) AS bin
WHERE form_factor.name = "phone"
)
WHERE
cdf >= 0.5
ERROR MESSAGE:Resources exceeded during query execution: The query could not be executed in the allotted memory. Peak usage: 115% of limit. Top memory consumer(s): sort operations used for analytic OVER() clauses: 98% other/unattributed: 2%
On Thursday, 1 February 2018 21:11:11 UTC, Rick Viscomi wrote:
#standardSQLSELECT MIN(start)FROM ( SELECT start, SUM(pdf) OVER (ORDER BY start) AS cdf FROM ( SELECT start, n / SUM(n) OVER () AS pdf FROM ( SELECT bin.start, SUM(bin.density) AS n FROM `chrome-ux-report.country_au.201903`, UNNEST(onload.histogram.bin) AS bin WHERE origin = 'https://www.dove.com' ANDRelated to my previous query...when running a query to find a specific speed percentile, in a specific country for a specific origin and specific device type using the query below, I sometimes get a null result. If I change the percentile, I often get a result in those cases. I've also tried a different table date and I can use that to get a result sometimes. Is the problem a lack of data? is there a way to overcome the problem, such as rewrite the query to include a range of tables? If so, how should the query be written. Your help is much appreciated.#standardSQLSELECTMIN(start) AS median_load
FROM (SELECTbin.start,SUM(bin.density) OVER (ORDER BY bin.start) AS cdfFROM
`chrome-ux-report.country_au.201903`,UNNEST(onLoad.histogram.bin) AS binWHEREWHEREcdf >= 0.5