@@ -214,16 +214,16 @@ export const PerformanceBuilders: Record<string, SimpleQueryConfig> = {
214214 avgIf(wv.metric_value, wv.metric_name = 'TTFB' AND wv.metric_value > 0) as avg_ttfb,
215215 COUNT(*) as measurements
216216 FROM ${ Analytics . web_vitals_spans } wv
217- LEFT JOIN ${ Analytics . events } e ON (
217+ INNER JOIN ${ Analytics . events } e ON (
218218 wv.session_id = e.session_id
219219 AND wv.client_id = e.client_id
220220 AND abs(dateDiff('second', wv.timestamp, e.time)) < 60
221+ AND e.browser_name != ''
221222 )
222223 WHERE
223224 wv.client_id = {websiteId:String}
224225 AND wv.timestamp >= toDateTime({startDate:String})
225226 AND wv.timestamp <= toDateTime(concat({endDate:String}, ' 23:59:59'))
226- AND e.browser_name != ''
227227 GROUP BY e.browser_name
228228 ORDER BY p50_lcp DESC
229229 LIMIT {limit:UInt32}
@@ -341,7 +341,7 @@ export const PerformanceBuilders: Record<string, SimpleQueryConfig> = {
341341 return {
342342 sql : `
343343 SELECT
344- CONCAT(any( e.region) , ', ', any( e.country) ) as name,
344+ CONCAT(e.region, ', ', e.country) as name,
345345 COUNT(DISTINCT wv.anonymous_id) as visitors,
346346 avgIf(wv.metric_value, wv.metric_name = 'FCP' AND wv.metric_value > 0) as avg_fcp,
347347 quantileIf(0.50)(wv.metric_value, wv.metric_name = 'FCP' AND wv.metric_value > 0) as p50_fcp,
@@ -353,16 +353,16 @@ export const PerformanceBuilders: Record<string, SimpleQueryConfig> = {
353353 avgIf(wv.metric_value, wv.metric_name = 'TTFB' AND wv.metric_value > 0) as avg_ttfb,
354354 COUNT(*) as measurements
355355 FROM ${ Analytics . web_vitals_spans } wv
356- LEFT JOIN ${ Analytics . events } e ON (
356+ INNER JOIN ${ Analytics . events } e ON (
357357 wv.session_id = e.session_id
358358 AND wv.client_id = e.client_id
359359 AND abs(dateDiff('second', wv.timestamp, e.time)) < 60
360+ AND e.region != ''
360361 )
361362 WHERE
362363 wv.client_id = {websiteId:String}
363364 AND wv.timestamp >= toDateTime({startDate:String})
364365 AND wv.timestamp <= toDateTime(concat({endDate:String}, ' 23:59:59'))
365- AND e.region != ''
366366 GROUP BY e.region, e.country
367367 ORDER BY p50_lcp DESC
368368 LIMIT {limit:UInt32}
0 commit comments