Skip to content

Commit 69bd4ab

Browse files
authored
Merge pull request #281 from jfontan/improvement/faster-example
examples: faster version of main.go example
2 parents cb170cd + 11f1752 commit 69bd4ab

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

frontend/src/App.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,10 @@ class App extends Component {
7979
SELECT f.repository_id, f.file_path,
8080
LANGUAGE(f.file_path, f.blob_content) AS lang, f.blob_content,
8181
UAST(f.blob_content, LANGUAGE(f.file_path, f.blob_content)) AS uast
82-
FROM files AS f
83-
JOIN commit_files cf ON
84-
f.repository_id=cf.repository_id AND
85-
f.file_path=cf.file_path AND
86-
f.blob_hash=cf.blob_hash AND
87-
f.tree_hash=cf.tree_hash
88-
JOIN refs ON
89-
cf.repository_id = refs.repository_id AND
90-
cf.commit_hash = refs.commit_hash
91-
WHERE ref_name = 'HEAD'
82+
FROM refs AS r
83+
NATURAL JOIN commit_files
84+
NATURAL JOIN files AS f
85+
WHERE r.ref_name = 'HEAD'
9286
AND f.file_path REGEXP('.*main.go')`
9387
},
9488

0 commit comments

Comments
 (0)