Commit a6973d26 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Compute partition to take advantage of the primary key.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2325 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 05136a48
...@@ -295,8 +295,12 @@ class MySQLDatabaseManager(DatabaseManager): ...@@ -295,8 +295,12 @@ class MySQLDatabaseManager(DatabaseManager):
raise ValueError, "Incorrect value reference found for " \ raise ValueError, "Incorrect value reference found for " \
"oid %d at tid %d: reference = %d" % (oid, value_serial, tid) "oid %d at tid %d: reference = %d" % (oid, value_serial, tid)
r = self.query("""SELECT compression, checksum, value, """ \ r = self.query("""SELECT compression, checksum, value, """ \
"""value_serial FROM obj WHERE oid = %d AND serial = %d""" % ( """value_serial FROM obj WHERE partition = %(partition)d """
oid, value_serial)) """AND oid = %(oid)d AND serial = %(serial)d""" % {
'partition': self._getPartition(oid),
'oid': oid,
'serial': value_serial,
})
compression, checksum, value, next_value_serial = r[0] compression, checksum, value, next_value_serial = r[0]
if value is None: if value is None:
logging.info("Multiple levels of indirection when " \ logging.info("Multiple levels of indirection when " \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment