On Sep 27, 2008, at 2:42 PM, Lachlan Deck wrote:
>>
>> Once we have that, we can move to the runtime pieces... That's
>> where the real fun starts... Consider that to fetch superclass in
>> case of horizontal inheritance, we'd need to do separate queries on
>> each subclass on the tree, and then combine the result in an in-
>> memory "union" and then apply in-memory sort ordering on top of
>> that :-)
>
> This last one may not require separate queries for each subclass.
> i.e., by definition horizontal inheritance ensures that each sub-
> entity has the super's attributes/relations in common.
This is a definition of OO inheritance in general - superclass
"properties" are shared between all subclasses.
> So I'd think you ought to be able to do a unioned fetch of these
> things across the immediate child entities and lazy fault anything
> unique to the child entities thereafter... no?
True, that could be a possible strategy. Hard to say how it will
perform in an "average case" (whatever that is), compared to the full
resolving of objects via separate queries and subsequent merge. At the
very minimum we'd need to optimize a very common special case of
"fetch a list and iterate through all elements", to prevent massive
faulting of individual objects. Some sort of smart batch faulting will
be needed... Maybe we can use some of the methodologies developed for
the paginated lists to optimize that. E.g. fetch all instances of a
particular subclass in the list, once any object of that instance is
requested from the list (and do that for both regular results and to-
many relationship lists).
Andrus
This archive was generated by hypermail 2.0.0 : Sat Sep 27 2008 - 08:46:42 EDT