@@ -137,47 +137,9 @@ LIMIT
137
137
`
138
138
139
139
const gcpMissingOneImplCountRawTemplate = `
140
- WITH UnsupportedFeatures AS (
141
- SELECT DISTINCT
142
- bfse1.WebFeatureID,
143
- bfse1.EventReleaseDate
144
- FROM
145
- BrowserFeatureSupportEvents bfse1
146
- {{ .BrowserSupportedFeaturesFilter }}
147
- {{ .ExcludedFeatureFilter }}
148
- ),
149
- OtherSupportedFeatures AS (
150
- SELECT
151
- bfse_other.WebFeatureID,
152
- bfse_other.EventReleaseDate
153
- FROM
154
- BrowserFeatureSupportEvents bfse_other
155
- WHERE
156
- bfse_other.SupportStatus = 'supported'
157
- AND bfse_other.TargetBrowserName IN UNNEST(@otherBrowserNames)
158
- {{ .OtherExcludedFeatureFilter }}
159
- GROUP BY
160
- bfse_other.WebFeatureID, bfse_other.EventReleaseDate
161
- HAVING
162
- -- Ensures all other browsers support the feature.
163
- COUNT(DISTINCT bfse_other.TargetBrowserName) = @numOtherBrowsers
164
- ),
165
- AggregatedCounts AS (
166
- SELECT
167
- uf.EventReleaseDate,
168
- COUNT(uf.WebFeatureID) AS FeatureCount
169
- FROM
170
- UnsupportedFeatures uf
171
- JOIN
172
- OtherSupportedFeatures osf
173
- ON uf.WebFeatureID = osf.WebFeatureID
174
- AND uf.EventReleaseDate = osf.EventReleaseDate
175
- GROUP BY
176
- uf.EventReleaseDate
177
- )
178
140
SELECT
179
141
r.EventReleaseDate,
180
- COALESCE(ac .FeatureCount, 0) AS Count
142
+ COALESCE(AggregatedCounts .FeatureCount, 0) AS Count
181
143
FROM (
182
144
SELECT DISTINCT
183
145
ReleaseDate AS EventReleaseDate
@@ -187,13 +149,38 @@ FROM (
187
149
BrowserName IN UNNEST(@allBrowserNames)
188
150
AND ReleaseDate >= @startAt
189
151
AND ReleaseDate < @endAt
190
- {{if .ReleaseDateParam }}
191
- AND ReleaseDate < @{{ .ReleaseDateParam }}
192
- {{end}}
193
- AND ReleaseDate < CURRENT_TIMESTAMP()
194
152
) r
195
- LEFT JOIN
196
- AggregatedCounts ac ON r.EventReleaseDate = ac.EventReleaseDate
153
+ LEFT JOIN (
154
+ SELECT
155
+ Unsupported.EventReleaseDate,
156
+ COUNT(Unsupported.WebFeatureID) AS FeatureCount
157
+ FROM (
158
+ SELECT DISTINCT
159
+ bfse1.WebFeatureID,
160
+ bfse1.EventReleaseDate
161
+ FROM
162
+ BrowserFeatureSupportEvents bfse1
163
+ {{ .BrowserSupportedFeaturesFilter }}
164
+ {{ .ExcludedFeatureFilter }}
165
+ ) Unsupported
166
+ JOIN (
167
+ SELECT
168
+ bfse_other.WebFeatureID,
169
+ bfse_other.EventReleaseDate
170
+ FROM
171
+ BrowserFeatureSupportEvents bfse_other
172
+ WHERE
173
+ bfse_other.SupportStatus = 'supported'
174
+ AND bfse_other.TargetBrowserName IN UNNEST(@otherBrowserNames)
175
+ GROUP BY
176
+ bfse_other.WebFeatureID, bfse_other.EventReleaseDate
177
+ HAVING
178
+ COUNT(DISTINCT bfse_other.TargetBrowserName) = @numOtherBrowsers
179
+ ) otherSupported ON Unsupported.WebFeatureID = otherSupported.WebFeatureID
180
+ AND Unsupported.EventReleaseDate = otherSupported.EventReleaseDate
181
+ GROUP BY
182
+ Unsupported.EventReleaseDate
183
+ ) AggregatedCounts ON r.EventReleaseDate = AggregatedCounts.EventReleaseDate
197
184
ORDER BY
198
185
r.EventReleaseDate DESC
199
186
LIMIT
0 commit comments