Skip to content

Commit 9ca1a1a

Browse files
committed
Fuse multiple DELETE calls into one for multilinks.
1 parent 74db01e commit 9ca1a1a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

roundup/backends/rdbms_common.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -944,11 +944,11 @@ def setnode(self, classname, nodeid, values, multilink_changes={}):
944944
# XXX numeric ids
945945
self.sql(sql, (int(nodeid), int(addid)))
946946
if remove:
947-
sql = 'delete from %s where nodeid=%s and linkid=%s'%(tn,
948-
self.arg, self.arg)
949-
for removeid in remove:
950-
# XXX numeric ids
951-
self.sql(sql, (int(nodeid), int(removeid)))
947+
s = ','.join([self.arg]*len(remove))
948+
sql = 'delete from %s where nodeid=%s and linkid in (%s)'%(tn,
949+
self.arg, s)
950+
# XXX numeric ids
951+
self.sql(sql, [int(nodeid)] + remove)
952952

953953
sql_to_hyperdb_value = {
954954
hyperdb.String : str,

0 commit comments

Comments
 (0)