[ZODB-Dev] RelStorage - what tables and indexes should be present?

Chris Withers chris at simplistix.co.uk
Tue Feb 1 03:16:20 EST 2011


Hi Shane,

I notice that one of my history-free storages only has 'new_oid' and 
'object_state' tables while all the others have 'new_oid', 'object_ref', 
'object_refs_added', 'object_state' and 'pack_object' tables.

What's special about this storage?

I also note that while the ones with lots of tables have this schema for 
object_state:

CREATE TABLE `object_state` (
   `zoid` bigint(20) NOT NULL,
   `tid` bigint(20) NOT NULL,
   `state` longblob,
   PRIMARY KEY (`zoid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1$$

...the one with only two tables has this schema:

CREATE TABLE `object_state` (
   `zoid` bigint(20) NOT NULL,
   `tid` bigint(20) NOT NULL,
   `state` longblob,
   PRIMARY KEY (`zoid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1$$

...which causes the following statement, which gets executed a lot, to 
be very slow:

SELECT tid FROM object_state ORDER BY tid DESC LIMIT 1

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
            - http://www.simplistix.co.uk


More information about the ZODB-Dev mailing list