Skip to content

Commit a7262a3

Browse files
committed
Merge commit '6cc514bf6fd5419dead03edc16b071d73ddb861d'
2 parents 91fc9f6 + 6cc514b commit a7262a3

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

benchmarks/queries/clickbench/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ Results look like
132132
```
133133

134134
### Q6: How many social shares meet complex multi-stage filtering criteria?
135+
135136
**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?
136137
**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
137138

@@ -159,6 +160,37 @@ WHERE
159160
```
160161
Result is empty,Since it has already been filtered by `"SocialAction" = 'share'`.
161162

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
171+
FROM hits
172+
GROUP BY "WatchID"
173+
ORDER BY "WatchID" DESC
174+
LIMIT 10;
175+
```
176+
177+
Results look like
178+
```
179+
+---------------------+------+------+----------+
180+
| WatchID | wmin | wmax | srefresh |
181+
+---------------------+------+------+----------+
182+
| 9223372033328793741 | 1368 | 1368 | 0 |
183+
| 9223371941779979288 | 1479 | 1479 | 0 |
184+
| 9223371906781104763 | 1638 | 1638 | 0 |
185+
| 9223371803397398692 | 1990 | 1990 | 0 |
186+
| 9223371799215233959 | 1638 | 1638 | 0 |
187+
| 9223371785975219972 | 0 | 0 | 0 |
188+
| 9223371776706839366 | 1368 | 1368 | 0 |
189+
| 9223371740707848038 | 1750 | 1750 | 0 |
190+
| 9223371715190479830 | 1368 | 1368 | 0 |
191+
| 9223371620124912624 | 1828 | 1828 | 0 |
192+
+---------------------+------+------+----------+
193+
```
162194

163195
## Data Notes
164196

benchmarks/queries/clickbench/extended.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ SELECT "SocialSourceNetworkID", "RegionID", COUNT(*), AVG("Age"), AVG("ParamPric
55
SELECT "ClientIP", "WatchID", COUNT(*) c, MIN("ResponseStartTiming") tmin, MEDIAN("ResponseStartTiming") tmed, MAX("ResponseStartTiming") tmax FROM hits WHERE "JavaEnable" = 0 GROUP BY "ClientIP", "WatchID" HAVING c > 1 ORDER BY tmed DESC LIMIT 10;
66
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" = 0 GROUP BY "ClientIP", "WatchID" HAVING c > 1 ORDER BY tp95 DESC LIMIT 10;
77
SELECT COUNT(*) AS ShareCount FROM hits WHERE "IsMobile" = 1 AND "MobilePhoneModel" LIKE 'iPhone%' AND "SocialAction" = 'share' AND "SocialSourceNetworkID" IN (5, 12) AND "ClientTimeZone" BETWEEN -5 AND 5 AND regexp_match("Referer", '\/campaign\/(spring|summer)_promo') IS NOT NULL AND CASE WHEN split_part(split_part("URL", 'resolution=', 2), '&', 1) ~ '^\d+$' THEN split_part(split_part("URL", 'resolution=', 2), '&', 1)::INT ELSE 0 END > 1920 AND 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" DESC LIMIT 10;

0 commit comments

Comments
 (0)