|
32 | 32 | - DROP INDEX language_idx ON files
|
33 | 33 | -
|
34 | 34 | ID: 'query06'
|
35 |
| - Name: 'Query by language using the pilosa index' |
36 |
| - Statements: |
37 |
| - - CREATE INDEX language_idx ON files USING pilosa (language(file_path, blob_content)) WITH (async = false) |
38 |
| - - SELECT file_path FROM files WHERE language(file_path, blob_content) = 'Go' |
39 |
| - - DROP INDEX language_idx ON files |
40 |
| -- |
41 |
| - ID: 'query07' |
42 | 35 | Name: 'Query all files from HEAD'
|
43 | 36 | Statements:
|
44 | 37 | - SELECT cf.file_path, f.blob_content FROM ref_commits r NATURAL JOIN commit_files cf NATURAL JOIN files f WHERE r.ref_name = 'HEAD' AND r.history_index = 0
|
45 | 38 | -
|
46 |
| - ID: 'query08' |
47 |
| - Name: 'Get all LICENSE blobs using pilosa index' |
48 |
| - Statements: |
49 |
| - - CREATE INDEX file_path_idx ON files USING pilosa (file_path) WITH (async = false) |
50 |
| - - SELECT blob_content FROM files WHERE file_path = 'LICENSE' |
51 |
| - - DROP INDEX file_path_idx ON files |
52 |
| -- |
53 |
| - ID: 'query09' |
| 39 | + ID: 'query07' |
54 | 40 | Name: '10 top repos by file count in HEAD'
|
55 | 41 | Statements:
|
56 | 42 | - SELECT repository_id, num_files FROM (SELECT COUNT(f.*) num_files, f.repository_id FROM ref_commits r INNER JOIN commit_files cf ON r.commit_hash = cf.commit_hash AND r.repository_id = cf.repository_id INNER JOIN files f ON cf.repository_id = f.repository_id AND cf.blob_hash = f.blob_hash AND cf.tree_hash = f.tree_hash AND cf.file_path = f.file_path WHERE r.ref_name = 'HEAD' GROUP BY f.repository_id) t ORDER BY num_files DESC LIMIT 10
|
57 | 43 | -
|
58 |
| - ID: 'query10' |
| 44 | + ID: 'query08' |
59 | 45 | Name: 'Top committers per repository'
|
60 | 46 | Statements:
|
61 | 47 | - SELECT * FROM (SELECT commit_author_email as author, repository_id as id, count(*) as num_commits FROM commits GROUP BY commit_author_email, repository_id) AS t ORDER BY num_commits DESC
|
62 | 48 | -
|
63 |
| - ID: 'query11' |
| 49 | + ID: 'query09' |
64 | 50 | Name: 'Top committers in all repositories'
|
65 | 51 | Statements:
|
66 | 52 | - SELECT * FROM (SELECT commit_author_email as author,count(*) as num_commits FROM commits GROUP BY commit_author_email) t ORDER BY num_commits DESC
|
67 | 53 | -
|
68 |
| - ID: 'query12' |
69 |
| - Name: 'Union operation with pilosa index' |
70 |
| - Statements: |
71 |
| - - CREATE INDEX file_path_idx ON files USING pilosa (file_path) WITH (async = false) |
72 |
| - - SELECT blob_content FROM files WHERE file_path = 'LICENSE' OR file_path = 'README.md' |
73 |
| - - DROP INDEX file_path_idx ON files |
74 |
| -- |
75 |
| - ID: 'query13' |
| 54 | + ID: 'query10' |
76 | 55 | Name: 'Count all commits with NOT operation'
|
77 | 56 | Statements:
|
78 | 57 | - SELECT COUNT(*) FROM commits WHERE NOT(commit_author_email = 'non existing email address');
|
79 | 58 | -
|
80 |
| - ID: 'query14' |
| 59 | + ID: 'query11' |
81 | 60 | Name: 'Count all commits with NOT operation and pilosa index'
|
82 | 61 | Statements:
|
83 | 62 | - CREATE INDEX email_idx ON commits USING pilosa (commit_author_email) WITH (async = false)
|
|
0 commit comments