Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sqlGit
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Muller Guenael
sqlGit
Commits
123d0063
Commit
123d0063
authored
Dec 23, 2015
by
Inkhey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tmp table for performance
parent
2b684043
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
31 deletions
+27
-31
sqlGit.py
sqlGit.py
+27
-31
No files found.
sqlGit.py
View file @
123d0063
...
...
@@ -393,30 +393,27 @@ class sqlGit(object):
from file f join date_file df
where f.dir=df.dir
and f.name=df.file;'''
)
#tmp table to gain time
c
.
execute
(
'''
create table tmp as
select
a.author_name || a.author_mail as author,
f.dir || f.file as file
from link_file_commits f, link_author_commits a
where ( f.commits=a.commits);
'''
)
self
.
conn
.
commit
()
c
.
execute
(
'''
create table edges as
select f1.file AS source , f2.file AS target,
count(distinct(f1.author)) as nbAuthors,
count(distinct(f1.author)) as weight
from
(
(select
a.author_name || a.author_mail as author,
f.dir || f.file as file
from link_file_commits f, link_author_commits a
where ( f.commits=a.commits)
)as f1
join
(select
a.author_name || a.author_mail as author,
f.dir || f.file as file
from link_file_commits f, link_author_commits a
where ( f.commits=a.commits)
)as f2
on f1.author = f2.author
and f1.file != f2.file
tmp as f1
join
tmp as f2
on f1.author = f2.author
and f1.file != f2.file
)
group by f1.file , f2.file;'''
)
self
.
conn
.
commit
()
...
...
@@ -437,6 +434,15 @@ class sqlGit(object):
where a.email=da.email
and a.name=da.name;'''
)
c
.
execute
(
'''
create table tmp as
select
a.author_name || a.author_mail as author,
f.dir || f.file as file
from link_file_commits f, link_author_commits a
where ( f.commits=a.commits);
'''
)
self
.
conn
.
commit
()
c
.
execute
(
'''
create table edges as
select a1.author AS source , a2.author AS target,
...
...
@@ -445,19 +451,9 @@ class sqlGit(object):
a1.file as label
from
(
(select
a.author_name || a.author_mail as author,
f.dir || f.file as file
from link_file_commits f, link_author_commits a
where ( f.commits=a.commits)
)as a1
tmp as a1
join
(select
a.author_name || a.author_mail as author,
f.dir || f.file as file
from link_file_commits f, link_author_commits a
where ( f.commits=a.commits)
)as a2
tmp as a2
on a1.file = a2.file
and a1.author != a2.author
)
...
...
@@ -507,7 +503,7 @@ class sqlGit(object):
''' drop current view'''
c
=
self
.
conn
.
cursor
()
listTable
=
(
'nodes'
,
'edges'
)
listTable
=
(
'nodes'
,
'edges'
,
'tmp'
)
for
table
in
listTable
:
c
.
execute
(
'DROP TABLE IF EXISTS '
+
table
+
' ;'
)
self
.
conn
.
commit
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment