<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <br>
    <div class="moz-cite-prefix">On 2/18/2016 5:05 AM, Stian Thorgersen
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAJgngAfGZx=C=g32gqYofJmzkhKvzEMXXodv4X-yq9vyoeWdEg@mail.gmail.com"
      type="cite">
      <div dir="ltr"><br>
        <div class="gmail_extra"><br>
          <div class="gmail_quote">On 18 February 2016 at 08:43, Marek
            Posolda <span dir="ltr">&lt;<a moz-do-not-send="true"
                href="mailto:mposolda@redhat.com" target="_blank">mposolda@redhat.com</a>&gt;</span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div bgcolor="#FFFFFF" text="#000000"><span class="">
                  <div>On 18/02/16 08:07, Stian Thorgersen wrote:<br>
                  </div>
                  <blockquote type="cite">
                    <div dir="ltr">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.</div>
                  </blockquote>
                </span> 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).</div>
            </blockquote>
            <div><br>
            </div>
            <div>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. </div>
            <div> </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    We don't do EAGER SQL loading of clients.  We just load every
    client/role when a realm is loaded.<br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Bill Burke
JBoss, a division of Red Hat
<a class="moz-txt-link-freetext" href="http://bill.burkecentral.com">http://bill.burkecentral.com</a></pre>
  </body>
</html>