You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SELECT"ClientIP", "WatchID", COUNT(*) c, MIN("ResponseStartTiming") tmin, APPROX_PERCENTILE_CONT(0.95) WITHIN GROUP (ORDER BY"ResponseStartTiming") tp95, MAX("ResponseStartTiming") tmax
116
116
FROM'hits.parquet'
117
117
WHERE"JavaEnable"=0-- filters to 32M of 100M rows
118
118
GROUP BY"ClientIP", "WatchID"
@@ -132,6 +132,7 @@ Results look like
132
132
```
133
133
134
134
### Q6: How many social shares meet complex multi-stage filtering criteria?
135
+
135
136
**Question**: What is the count of sharing actions from iPhone mobile users on specific social networks, within common timezones, participating in seasonal campaigns, with high screen resolutions and closely matched UTM parameters?
136
137
**Important Query Properties**: Simple filter with high-selectivity, Costly string matching, A large number of filters with high overhead are positioned relatively later in the process
137
138
@@ -159,6 +160,37 @@ WHERE
159
160
```
160
161
Result is empty,Since it has already been filtered by `"SocialAction" = 'share'`.
161
162
163
+
### Q7: Device Resolution and Refresh Behavior Analysis
164
+
165
+
**Question**: Identify the top 10 WatchIDs with the highest resolution range (min/max "ResolutionWidth") and total refresh count ("IsRefresh") in descending WatchID order
166
+
167
+
**Important Query Properties**: Primitive aggregation functions, group by single primitive column, high cardinality grouping
168
+
169
+
```sql
170
+
SELECT"WatchID", MIN("ResolutionWidth") as wmin, MAX("ResolutionWidth") as wmax, SUM("IsRefresh") as srefresh
SELECT"BrowserCountry", COUNT(DISTINCT "SocialNetwork"), COUNT(DISTINCT "HitColor"), COUNT(DISTINCT "BrowserLanguage"), COUNT(DISTINCT "SocialAction") FROM hits GROUP BY1ORDER BY2DESCLIMIT10;
4
4
SELECT"SocialSourceNetworkID", "RegionID", COUNT(*), AVG("Age"), AVG("ParamPrice"), STDDEV("ParamPrice") as s, VAR("ParamPrice") FROM hits GROUP BY"SocialSourceNetworkID", "RegionID"HAVING s IS NOT NULLORDER BY s DESCLIMIT10;
5
5
SELECT"ClientIP", "WatchID", COUNT(*) c, MIN("ResponseStartTiming") tmin, MEDIAN("ResponseStartTiming") tmed, MAX("ResponseStartTiming") tmax FROM hits WHERE"JavaEnable"=0GROUP BY"ClientIP", "WatchID"HAVING c >1ORDER BY tmed DESCLIMIT10;
6
-
SELECT"ClientIP", "WatchID", COUNT(*) c, MIN("ResponseStartTiming") tmin, APPROX_PERCENTILE_CONT("ResponseStartTiming", 0.95) tp95, MAX("ResponseStartTiming") tmax FROM'hits'WHERE"JavaEnable"=0GROUP BY"ClientIP", "WatchID"HAVING c >1ORDER BY tp95 DESCLIMIT10;
6
+
SELECT"ClientIP", "WatchID", COUNT(*) c, MIN("ResponseStartTiming") tmin, APPROX_PERCENTILE_CONT(0.95) WITHIN GROUP (ORDER BY"ResponseStartTiming") tp95, MAX("ResponseStartTiming") tmax FROM'hits'WHERE"JavaEnable"=0GROUP BY"ClientIP", "WatchID"HAVING c >1ORDER BY tp95 DESCLIMIT10;
7
7
SELECTCOUNT(*) AS ShareCount FROM hits WHERE"IsMobile"=1AND"MobilePhoneModel"LIKE'iPhone%'AND"SocialAction"='share'AND"SocialSourceNetworkID"IN (5, 12) AND"ClientTimeZone" BETWEEN -5AND5AND regexp_match("Referer", '\/campaign\/(spring|summer)_promo') IS NOT NULLAND CASE WHEN split_part(split_part("URL", 'resolution=', 2), '&', 1) ~ '^\d+$' THEN split_part(split_part("URL", 'resolution=', 2), '&', 1)::INT ELSE 0 END >1920AND levenshtein(CAST("UTMSource"AS STRING), CAST("UTMCampaign"AS STRING)) <3;
8
+
SELECT"WatchID", MIN("ResolutionWidth") as wmin, MAX("ResolutionWidth") as wmax, SUM("IsRefresh") as srefresh FROM hits GROUP BY"WatchID"ORDER BY"WatchID"DESCLIMIT10;
0 commit comments