Mercurial > p > roundup > code
comparison roundup/backends/rdbms_common.py @ 2228:1d1362c54c94
Some doc / comment fixes.
Added tools/load_tracker.py - see its usage string. Used to load a tracker
with data for load testing. Preliminary results: sqlite, mysql, postgresql
and metakit break *no* sweat with 2000 issues (approx 1700-1800 "open").
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Tue, 20 Apr 2004 05:47:33 +0000 |
| parents | 98d3bf8ffb19 |
| children | 70d21059aa18 |
comparison
equal
deleted
inserted
replaced
| 2227:15c20983fd13 | 2228:1d1362c54c94 |
|---|---|
| 1 # $Id: rdbms_common.py,v 1.91 2004-04-18 05:31:02 richard Exp $ | 1 # $Id: rdbms_common.py,v 1.92 2004-04-20 05:47:33 richard Exp $ |
| 2 ''' Relational database (SQL) backend common code. | 2 ''' Relational database (SQL) backend common code. |
| 3 | 3 |
| 4 Basics: | 4 Basics: |
| 5 | 5 |
| 6 - map roundup classes to relational tables | 6 - map roundup classes to relational tables |
| 388 spec.classname, spec.key, | 388 spec.classname, spec.key, |
| 389 spec.classname, spec.key) | 389 spec.classname, spec.key) |
| 390 if __debug__: | 390 if __debug__: |
| 391 print >>hyperdb.DEBUG, 'create_index', (self, index_sql3) | 391 print >>hyperdb.DEBUG, 'create_index', (self, index_sql3) |
| 392 self.cursor.execute(index_sql3) | 392 self.cursor.execute(index_sql3) |
| 393 | |
| 394 # TODO: create indexes on (selected?) Link property columns, as | |
| 395 # they're more likely to be used for lookup | |
| 393 | 396 |
| 394 def drop_class_table_indexes(self, cn, key): | 397 def drop_class_table_indexes(self, cn, key): |
| 395 # drop the old table indexes first | 398 # drop the old table indexes first |
| 396 l = ['_%s_id_idx'%cn, '_%s_retired_idx'%cn] | 399 l = ['_%s_id_idx'%cn, '_%s_retired_idx'%cn] |
| 397 if key: | 400 if key: |
| 1707 | 1710 |
| 1708 'propname' must be the name of a String property of this class or | 1711 'propname' must be the name of a String property of this class or |
| 1709 None, or a TypeError is raised. The values of the key property on | 1712 None, or a TypeError is raised. The values of the key property on |
| 1710 all existing nodes must be unique or a ValueError is raised. | 1713 all existing nodes must be unique or a ValueError is raised. |
| 1711 ''' | 1714 ''' |
| 1712 # XXX create an index on the key prop column. We should also | |
| 1713 # record that we've created this index in the schema somewhere. | |
| 1714 prop = self.getprops()[propname] | 1715 prop = self.getprops()[propname] |
| 1715 if not isinstance(prop, String): | 1716 if not isinstance(prop, String): |
| 1716 raise TypeError, 'key properties must be String' | 1717 raise TypeError, 'key properties must be String' |
| 1717 self.key = propname | 1718 self.key = propname |
| 1718 | 1719 |
