Skip to content

Instantly share code, notes, and snippets.

@cwsteinbach
Created April 17, 2013 02:17
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 cwsteinbach/f3fc09ce6389db28676a to your computer and use it in GitHub Desktop.
Save cwsteinbach/f3fc09ce6389db28676a to your computer and use it in GitHub Desktop.
GithubArchive queries for ZFS compression performance tests.
-- Q1. Total row count
SELECT
count(*)
FROM
githubarchive;
-- Q2. Number of rows with language Ruby
SELECT
count(*)
FROM
githubarchive
WHERE
repository_language = 'Ruby';
-- Q3. Top 10 repos by number of pushes
SELECT
repository_name, count(repository_name) as pushes
FROM
githubarchive
GROUP BY
repository_name
ORDER BY
pushes DESC
LIMIT 10;
-- Q4. Distribution of different events on GitHub
SELECT
type, count(type) as cnt
FROM
githubarchive
GROUP BY
type
ORDER BY
cnt DESC
LIMIT 10;
-- Q5. Distribution of different repository languages on GitHub
SELECT
repository_language, count(repository_language) as cnt
FROM
githubarchive
GROUP BY
repository_language
ORDER BY
cnt DESC
LIMIT 10;
-- Q6. Show pagespeed events
SELECT
count(*)
FROM
githubarchive
WHERE
payload_commit_msg LIKE '%pagespeed%';
-- Q7. Aveage repository size
SELECT
avg(repository_size)
FROM
githubarchive;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment