Forum OpenACS Development: Response to PG Object Extensions - pros and cons

Collapse
Posted by Don Baccus on
Thanks, Dan!

The first two tests (both on users, one using inherits, the other not)  do essentially the same thing, since the inherited classes physically are part of the users table (simple vs. virtual inheritance  in C++ terms).

What you're seeing, then, is the difference in time required to return  rows of sizeof(user) length vs. sizeof(user)+sizeof(party)+sizeof(person)+sizeof(object) length.

The tradeoff, then, is a slower query if all you want is stuff from the user table.  But ... that time's constant for any query on users no matter how many of the inherited columns you want to return.

Another one to test is:

select count(*) from acs_objects

for both cases.  The inheritance case needs to UNION acs_objects, parties, persons, and users while the non-inheritance case only needs to interrogate the acs_objects table.

In other words, the join case to build the entire child class loses vs. inheritance, but grabbing stuff from the base class by implicit UNION will lose vs. the relational datamodel.  The actual numbers would be interesting to see.  Make sure you have all necessary indexes  declared ...