On 18 February 2016 at 08:43, Marek Posolda <mposolda@redhat.com> wrote:
On 18/02/16 08:07, Stian Thorgersen wrote:
Maybe clients and roles (and groups?) shouldn't be loaded eagerly with realm, but I guess most of the other stuff can be (ie. federation providers, identity providers, SMTP configurations etc). Also for clients we can eagerly load most of the stuff (ie. redirectUris, scopes ). ATM we eagerly preload whole realm in CachedRealm constructor, but we have fetchType.LAZY everywhere. IMO this is not optimal and would mean lot of SQL at startup during realm preload (I did not doublecheck myself).Having two many joins (fetching everything about a realm in one query) is probably going to be bad for performance, especially if there are loads of clients and roles. There can also be large difference between different vendors.
I don't really think it's a priority and I suspect performance might actually be worse if we do a lot of eager loading than lazy loading. Depends on how Hibernate loads it of course, but if it does it through a crazy join then performance will suffer.
-- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com