Skip to content

Commit

Permalink
#11147: use index for ticket.id column to prevent slow deleting tags …
Browse files Browse the repository at this point in the history
…records
  • Loading branch information
jun66j5 committed Oct 18, 2013
1 parent c80a56a commit 7bba2e1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tractags/ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,9 @@ def _fetch_tkt_tags(self, db):
rw_cursor.execute("""
DELETE FROM tags
WHERE tagspace=%%s
AND NOT EXISTS (SELECT * FROM ticket AS tkt WHERE %s=tags.name)
""" % db.cast('tkt.id', 'text'),
AND NOT EXISTS (SELECT * FROM ticket AS tkt
WHERE tkt.id=%s%s)
""" % (db.cast('tags.name', 'int'), ignore),
(self.realm,))

self.log.debug('ENTER_TAG_DB_CHECKOUT')
Expand Down

0 comments on commit 7bba2e1

Please sign in to comment.