mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-28 15:46:33 +00:00
refactor(archive): sqlite query optimization. replace or-ed equal conditions list with in-list
This commit is contained in:
parent
b84c54bbcb
commit
8c7a931f65
@ -255,10 +255,10 @@ proc whereClause(cursor: Option[DbCursor],
|
||||
let contentTopicClause = if contentTopic.len <= 0:
|
||||
none(string)
|
||||
else:
|
||||
var where = "("
|
||||
where &= "contentTopic = (?)"
|
||||
for _ in contentTopic[1..^1]:
|
||||
where &= " OR contentTopic = (?)"
|
||||
var where = "contentTopic IN ("
|
||||
where &= "?"
|
||||
for _ in 1..<contentTopic.len:
|
||||
where &= ", ?"
|
||||
where &= ")"
|
||||
some(where)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user