jml and I spent some time talking about this, and much of what we do in code can be done with the following single sql call. It is however a little slow (https://pastebin.canonical.com/14346/). Can this be made faster? Or should we look into denormalisation?
select count(distinct(Revision.id)) as revision_count,
count(distinct(
coalesce(RevisionAuthor.person, -RevisionAuthor.id))) as committer_count
from Revision
join RevisionAuthor on Revision.revision_author = RevisionAuthor.id
join BranchRevision on BranchRevision.revision = Revision.id
join Branch on BranchRevision.branch = Branch.id
where
Revision.revision_date > '2009-02-01'
AND Revision.revision_date <= '2009-02-27'
and Branch.product = 10294
and BranchRevision.revision >= (
select min(id) from revision where revision_date > '2009-02-01')
jml and I spent some time talking about this, and much of what we do in code can be done with the following single sql call. It is however a little slow (https:/ /pastebin. canonical. com/14346/). Can this be made faster? Or should we look into denormalisation?
select count(distinct( Revision. id)) as revision_count, RevisionAuthor. person, -RevisionAuthor .id))) as committer_count revision_ author = RevisionAuthor.id revision = Revision.id branch = Branch.id revision_ date > '2009-02-01' revision_ date <= '2009-02-27' revision >= (
count(distinct(
coalesce(
from Revision
join RevisionAuthor on Revision.
join BranchRevision on BranchRevision.
join Branch on BranchRevision.
where
Revision.
AND Revision.
and Branch.product = 10294
and BranchRevision.
select min(id) from revision where revision_date > '2009-02-01')