[sqlalchemy] Re: Bug? Polymorphic inheritance 100 times slower

2007-07-16 Thread Michael Bayer
On Jul 16, 2007, at 1:58 PM, [EMAIL PROTECTED] wrote: > Storing just the base-most class would solve some (speed) issues, but > others will remain - for each Class u'll have to do > 1 get mapper for the Class > 2 find the Base - the base-most mapper - or first concrete one > towards root > 3

[sqlalchemy] Re: Bug? Polymorphic inheritance 100 times slower

2007-07-16 Thread sdobrev
On Monday 16 July 2007 18:21:42 Michael Bayer wrote: > On Jul 16, 2007, at 10:45 AM, svilen wrote: > > i think it is not a problem to store as many keys as there are > > identical levels in polymorphism/inheritance as long as this is > > synchronized with type of inheritance. > > i.e. joined-table

[sqlalchemy] Re: Bug? Polymorphic inheritance 100 times slower

2007-07-16 Thread Michael Bayer
On Jul 16, 2007, at 10:45 AM, svilen wrote: > > i think it is not a problem to store as many keys as there are > identical levels in polymorphism/inheritance as long as this is > synchronized with type of inheritance. > i.e. joined-table inheritance chains (and single table maybe) are ok > as is

[sqlalchemy] Re: Bug? Polymorphic inheritance 100 times slower

2007-07-16 Thread svilen
On Monday 16 July 2007 17:08:08 Michael Bayer wrote: > On Jul 16, 2007, at 2:59 AM, Yves-Eric wrote: > > Thanks for the explanation! The root of the issue is now very > > clear. But are you saying that this is intended behavior? Was I > > wrong in trying to use the session as an object cache? > >

[sqlalchemy] Re: Bug? Polymorphic inheritance 100 times slower

2007-07-16 Thread Michael Bayer
On Jul 16, 2007, at 2:59 AM, Yves-Eric wrote: > > Thanks for the explanation! The root of the issue is now very clear. > But are you saying that this is intended behavior? Was I wrong in > trying to use the session as an object cache? this is why im extremely hesitant to call the session a "cac

[sqlalchemy] Re: Bug? Polymorphic inheritance 100 times slower

2007-07-16 Thread svilen
On Monday 16 July 2007 09:59:41 Yves-Eric wrote: > Thanks for the explanation! The root of the issue is now very > clear. But are you saying that this is intended behavior? Was I > wrong in trying to use the session as an object cache? > > Now onto a possible solution or workaround... Please forgi

[sqlalchemy] Re: Bug? Polymorphic inheritance 100 times slower

2007-07-15 Thread Yves-Eric
Thanks for the explanation! The root of the issue is now very clear. But are you saying that this is intended behavior? Was I wrong in trying to use the session as an object cache? Now onto a possible solution or workaround... Please forgive me if the following does not make sense, but would it b

[sqlalchemy] Re: Bug? Polymorphic inheritance 100 times slower

2007-07-15 Thread Michael Bayer
the "non polymorphic" search is against the Person mapper; it recieves id "1" and looks in the identity map for (Person, (1,)) and locates the existing object immediately. For id 2, it also looks in the map for (Person, (2,)), and finds nothing; it must issue a query which returns the fa