Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
f6edf6ac
Commit
f6edf6ac
authored
Sep 23, 2016
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
X .
parent
a1018ff0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
neo/storage/database/mysqldb.py
neo/storage/database/mysqldb.py
+10
-1
No files found.
neo/storage/database/mysqldb.py
View file @
f6edf6ac
...
...
@@ -330,7 +330,12 @@ class MySQLDatabaseManager(DatabaseManager):
return
util
.
p64
(
r
[
0
][
0
])
if
r
else
None
def
_getNextTID
(
self
,
*
args
):
# partition, oid, tid
#" USE INDEX(PRIMARY)"
# " USE KEY(`partition`, oid, tid)" says 'tid' is not in 'oid' XXX why ?
# ANSWER -> index name is SHOW INDEX FROM tbl; -> Key_name
# " FORCE INDEX(`partition`)"
r
=
self
.
query
(
"SELECT tid FROM obj"
" USE INDEX(`partition`)"
" WHERE `partition`=%d AND oid=%d AND tid>%d"
" ORDER BY tid LIMIT 1"
%
args
)
return
r
[
0
][
0
]
if
r
else
None
...
...
@@ -667,9 +672,13 @@ class MySQLDatabaseManager(DatabaseManager):
p64
=
util
.
p64
min_tid
=
u64
(
min_tid
)
max_tid
=
u64
(
max_tid
)
# AND tid >= %(min_tid)d AND tid <= %(max_tid)d
# ORDER BY tid ASC LIMIT %(length)d""" % {
# ORDER BY tid ASC LIMIT %(length)d""" % {
r
=
self
.
query
(
"""SELECT tid FROM trans
FORCE INDEX FOR ORDER BY (PRIMARY)
WHERE `partition` = %(partition)d
AND tid
>= %(min_tid)d AND tid <=
%(max_tid)d
AND tid
BETWEEN %(min_tid)d AND
%(max_tid)d
ORDER BY tid ASC LIMIT %(length)d"""
%
{
'partition'
:
partition
,
'min_tid'
:
min_tid
,
...
...
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