mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 09:22:31 -06:00
help the query planner
This commit is contained in:
parent
af9000d3c8
commit
0143380306
|
@ -2413,7 +2413,7 @@ class HttpCli(object):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
w = r[0][:16]
|
w = r[0][:16]
|
||||||
q = "select k, v from mt where w = ? and k != 'x'"
|
q = "select k, v from mt where w = ? and +k != 'x'"
|
||||||
try:
|
try:
|
||||||
for k, v in icur.execute(q, (w,)):
|
for k, v in icur.execute(q, (w,)):
|
||||||
taglist[k] = True
|
taglist[k] = True
|
||||||
|
|
|
@ -328,7 +328,7 @@ class U2idx(object):
|
||||||
w = hit["w"]
|
w = hit["w"]
|
||||||
del hit["w"]
|
del hit["w"]
|
||||||
tags = {}
|
tags = {}
|
||||||
q2 = "select k, v from mt where w = ? and k != 'x'"
|
q2 = "select k, v from mt where w = ? and +k != 'x'"
|
||||||
for k, v2 in cur.execute(q2, (w,)):
|
for k, v2 in cur.execute(q2, (w,)):
|
||||||
taglist[k] = True
|
taglist[k] = True
|
||||||
tags[k] = v2
|
tags[k] = v2
|
||||||
|
|
|
@ -949,7 +949,7 @@ class Up2k(object):
|
||||||
n_done += 1
|
n_done += 1
|
||||||
|
|
||||||
for w in to_delete.keys():
|
for w in to_delete.keys():
|
||||||
q = "delete from mt where w = ? and k = 't:mtp'"
|
q = "delete from mt where w = ? and +k = 't:mtp'"
|
||||||
cur.execute(q, (w,))
|
cur.execute(q, (w,))
|
||||||
|
|
||||||
to_delete = {}
|
to_delete = {}
|
||||||
|
@ -987,7 +987,7 @@ class Up2k(object):
|
||||||
with self.mutex:
|
with self.mutex:
|
||||||
done = self._flush_mpool(wcur)
|
done = self._flush_mpool(wcur)
|
||||||
for w in done:
|
for w in done:
|
||||||
q = "delete from mt where w = ? and k = 't:mtp'"
|
q = "delete from mt where w = ? and +k = 't:mtp'"
|
||||||
cur.execute(q, (w,))
|
cur.execute(q, (w,))
|
||||||
|
|
||||||
cur.connection.commit()
|
cur.connection.commit()
|
||||||
|
@ -1115,7 +1115,7 @@ class Up2k(object):
|
||||||
|
|
||||||
for k in tags.keys():
|
for k in tags.keys():
|
||||||
q = "delete from mt where w = ? and ({})".format(
|
q = "delete from mt where w = ? and ({})".format(
|
||||||
" or ".join(["k = ?"] * len(tags))
|
" or ".join(["+k = ?"] * len(tags))
|
||||||
)
|
)
|
||||||
args = [wark[:16]] + list(tags.keys())
|
args = [wark[:16]] + list(tags.keys())
|
||||||
write_cur.execute(q, tuple(args))
|
write_cur.execute(q, tuple(args))
|
||||||
|
|
Loading…
Reference in a new issue