Permalink
Browse files

#11147: use index for ticket.id column to prevent slow deleting tags …

…records
  • Loading branch information...
1 parent c80a56a commit 7bba2e1558c9f8c210172026d1a7a92b3c9cad8b @jun66j5 committed Oct 18, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 tractags/ticket.py
View
@@ -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')

0 comments on commit 7bba2e1

Please sign in to comment.