2 Replies Latest reply on Jan 30, 2004 1:08 PM by mbeyer73

    findAll: superflous where clause?

    mbeyer73 Newbie

      Hi all,

      I am doing my first steps with JBoss (3.2.3) and CMP (2.0).

      wondering about the poor performance of my finder methods I took a look into the SQL that went to the database.

      "SELECT DISTINCT OBJECT(p) FROM Person p"

      results in

      SELECT PersonID, FirstName, LastName, [etc.] FROM person WHERE (PersonID='5354B71CC0A80113008BD3BB11A57FA1') OR (PersonID='5354B893C0A80113008BD3BB3C6918FF') OR (PersonID='5354B910C0A80113008BD3BBC83093BE') OR [etc.]

      where thousands of primary keys are listed. This query costs ~ 4 seconds on my box.

      A query without WHERE costs ~ 0 seconds. So why this "WHERE" clause?

      Is this a JBoss specific problem? Am I doing something wrong?

      thanx!
      Marcus