cancel
Showing results for 
Search instead for 
Did you mean: 

Task query slow

mahavirj
Champ in-the-making
Champ in-the-making
I have a task query (below) that returns more than 4000 tasks and am getting the first 50 to be displayed back on screen.  This takes over 40 seconds in tomcat/sqlserver for a single user test. I've checked the query issued by activiti and it takes less than a second in sqlserver. jvm heap size is 1024m and should be adequate for this data.

taskService.createTaskQuery().processDefinitionKey("orders").taskName("review order").taskUnnassigned().list().subList(1,50);

Any clues on what could be going on?
3 REPLIES 3

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Yes, you should limit it with normal paging aggording the query api. Now it build object models of all 4000 tasks and then takes a sublist from that.

mahavirj
Champ in-the-making
Champ in-the-making
thanks, using the listpage api worked much better

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Great to hear. Thanks for the feedback.