-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Some gitbase-web examples look outdated, not using simplest syntax or not the most performance one. This needs a review by the gitbase devs to have optimal examples.
Example:
/* Commits per committer, each month of 2018, for each repository */
SELECT COUNT(*) as num_commits, month, repository_id, committer_name, committer_email
FROM ( SELECT MONTH(committer_when) as month,
r.repository_id,
committer_name,
committer_email
FROM ref_commits r
INNER JOIN commits c
ON YEAR(c.committer_when) = 2018 AND r.commit_hash = c.commit_hash
WHERE r.ref_name = 'HEAD'
) as t GROUP BY committer_email, committer_name, month, repository_id
Shouldn't that be a NATURAL JOIN
? Shouldn't the YEAR
condition be in WHERE
?
carlosms
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request