11 Replies Latest reply on May 27, 2004 2:56 AM by Alexey Loubyansky

    curious SQL-Statements when loading related data

    Frank Langelage Master

      I have existing database tables for order and /line item.
      Orders are in Table afsta represented by EB Afsta, line items are in Table afpos represented by EB Afpos.
      Afsta has afstaSerial as PK, Afpos has afposSerial as PK and afstaSerial as FK.

      In server.log I found this lines:
      [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadRelationCommand.Afsta.execute] load relation SQL: SELECT afpos_serial FROM AFPOS WHERE (afsta_serial=?)
      [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.Afpos.execute] Executing SQL: SELECT afpos_serial, var_id FROM AFPOS WHERE (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?)
      [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.Afpos.execute] Executing SQL: SELECT afpos_serial, tst_nr FROM AFPOS WHERE (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?)
      [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.Afpos.execute] Executing SQL: SELECT afpos_serial, var_fam_nr FROM AFPOS WHERE (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?) OR (afpos_serial=?)

      and so on.

      First the keys are ascertained and then the rows should be loaded.
      But every access to afpos loads only one additional field (var_id, tst_nr, var_fam_nr, ...).
      At the end, the whole data is there, but this is not very fast.

      Any ideas ?
      Is this perhaps a bug ?