Skip to content

Instantly share code, notes, and snippets.

@rhelmer
Created February 20, 2014 00:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rhelmer/9104672 to your computer and use it in GitHub Desktop.
Save rhelmer/9104672 to your computer and use it in GitHub Desktop.
WITH crash AS (
SELECT json_object_field_text(processed_crash, 'cpu_name') AS cpu_name,
json_object_field_text(processed_crash, 'os_name') AS os_name,
json_object_field_text(processed_crash, 'signature') AS signature,
trim('"' from (
string_to_array(
json_object_field_text(processed_crash, 'cpu_info'), '|')
)[2]
) AS core_count
FROM processed_crashes
JOIN reports_clean ON (processed_crashes.uuid::text = reports_clean.uuid)
JOIN product_versions USING (product_version_id)
WHERE reports_clean.date_processed
BETWEEN '2014-02-18 00:00:00' AND '2014-02-18 01:00:00'
AND product_name = 'Firefox'
AND version_string = '30.0a1'
)
SELECT cpu_name, core_count, signature, count(cpu_name) as total
FROM crash
GROUP BY signature, core_count, cpu_name
ORDER BY total DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment