[Collab-qa-commits] r1107 - in udd: . src/udd
lucas at alioth.debian.org
lucas at alioth.debian.org
Sun Aug 17 12:43:04 UTC 2008
Author: lucas
Date: 2008-08-17 12:43:03 +0000 (Sun, 17 Aug 2008)
New Revision: 1107
Modified:
udd/TODO
udd/src/udd/packages_gatherer.py
Log:
TRUNCATE is a bad idea (locks tables)
Modified: udd/TODO
===================================================================
--- udd/TODO 2008-08-17 12:24:24 UTC (rev 1106)
+++ udd/TODO 2008-08-17 12:43:03 UTC (rev 1107)
@@ -14,7 +14,6 @@
- tables structure, in a relatively friendly format
- some example queries
- (prio: medium) primary key for tables which have none yet
-- (prio: high) investigate use of TRUNCATE to empty tables, instead of DELETE FROM
packages/sources
----------------
Modified: udd/src/udd/packages_gatherer.py
===================================================================
--- udd/src/udd/packages_gatherer.py 2008-08-17 12:24:24 UTC (rev 1106)
+++ udd/src/udd/packages_gatherer.py 2008-08-17 12:43:03 UTC (rev 1107)
@@ -186,7 +186,7 @@
print "Could not read packages from %s: %s" % (path, message)
cur.execute("DEALLOCATE package_insert")
# Fill the summary tables
- cur.execute("TRUNCATE %s" % (table + '_summary'));
+ cur.execute("DELETE FROM %s" % (table + '_summary'));
cur.execute("""INSERT INTO %s SELECT DISTINCT ON (package, version,
distribution, release, component) package, version, source,
source_version, maintainer, distribution, release, component FROM %s""" %
More information about the Collab-qa-commits
mailing list