2 Replies Latest reply on Jun 12, 2003 4:51 AM by Grzegorz Stelmaszek

    findBy... () performance

    sal ingrilli Newbie

      Take a SYSTEM_USER table with FIRST_NAME column.

      If I perform a findByFirstName (), is the CMP engine going to go to the database?

      What if I create a custom container-configuration (see standardjboss.xml) that gives the SystemUser entity enough memory to stay cached, and I perform a findByFirstName (), is it still going to the DB?

      If it does hit the database every time, does it mean that the performance gain in caching, is limited to the fetching of the full-records?

      If it does hit the database every time, does this mean that what I need to do is carefully use:
      1. database index
      2. findBy () that uses the index
      3. setting read-ahead / other findBy () parameters to ask JBoss-CMP to fetch the findBy () results in group instead of 1 by 1

      How does this change whether I'm using EJB-QL, JBOSS-QL, jaws, JBOSS-SQL?

      Any comments/advice?