11 Replies Latest reply on Sep 24, 2003 11:42 PM by Alex Paransky

    Too many selects (N+1) executed by JBOSS on finders

    Alex Paransky Newbie

      I am using JBOSS 3.2.2RC3, and it seems that when a finder is executing it first selects the keys and then proceeds to execute a SELECT statement for EVERY row returned.

      So, if I return 100 elements in the finder, JBOSS executes 100 SELECT statements to find the data. So in total I get N+1 select statements. This is very slow and quite expensive on the database side.

      I am sure this has been asked before, but what is a way around this?