Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
neoppod
Commits
c4443632
Commit
c4443632
authored
May 09, 2024
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sqlite: fix performance issue in replication
parent
5923f8f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
7 deletions
+19
-7
neo/storage/database/sqlite.py
neo/storage/database/sqlite.py
+19
-7
No files found.
neo/storage/database/sqlite.py
View file @
c4443632
...
@@ -740,17 +740,29 @@ class SQLiteDatabaseManager(DatabaseManager):
...
@@ -740,17 +740,29 @@ class SQLiteDatabaseManager(DatabaseManager):
def
getReplicationObjectList
(
self
,
min_tid
,
max_tid
,
length
,
partition
,
def
getReplicationObjectList
(
self
,
min_tid
,
max_tid
,
length
,
partition
,
min_oid
):
min_oid
):
if
max_tid
<
min_tid
or
length
==
0
:
return
()
u64
=
util
.
u64
u64
=
util
.
u64
p64
=
util
.
p64
p64
=
util
.
p64
min_tid
=
u64
(
min_tid
)
min_tid
=
u64
(
min_tid
)
if
length
is
None
:
if
not
length
:
length
=
-
1
length
=
-
1
return
[(
p64
(
serial
),
p64
(
oid
))
for
serial
,
oid
in
self
.
query
(
"""
\
r
=
[(
p64
(
serial
),
p64
(
oid
))
for
serial
,
oid
in
self
.
query
(
SELECT tid, oid FROM obj
"SELECT tid, oid FROM obj"
WHERE partition=? AND tid<=?
" WHERE partition=? AND tid=? AND ?<=oid"
AND (tid=? AND ?<=oid OR ?<tid)
" ORDER BY tid ASC, oid ASC LIMIT ?"
,
ORDER BY tid ASC, oid ASC LIMIT ?"""
,
(
partition
,
min_tid
,
u64
(
min_oid
),
length
))]
(
partition
,
u64
(
max_tid
),
min_tid
,
u64
(
min_oid
),
min_tid
,
length
))]
if
length
>
0
:
length
-=
len
(
r
)
if
not
length
:
return
r
for
serial
,
oid
in
self
.
query
(
"SELECT tid, oid FROM obj"
" WHERE partition=? AND ?<tid AND tid<=?"
" ORDER BY tid ASC, oid ASC LIMIT ?"
,
(
partition
,
min_tid
,
u64
(
max_tid
),
length
)):
r
.
append
((
p64
(
serial
),
p64
(
oid
)))
return
r
def
_getTIDList
(
self
,
offset
,
length
,
partition_list
):
def
_getTIDList
(
self
,
offset
,
length
,
partition_list
):
return
(
t
[
0
]
for
t
in
self
.
query
(
return
(
t
[
0
]
for
t
in
self
.
query
(
...
...
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