Bug 1184521

Summary: Paging is not performant for the REST rich Task query operation
Product: [Retired] JBoss BPMS Platform 6 Reporter: Marco Rietveld <mrietvel>
Component: Business CentralAssignee: Shelly McGowan <smcgowan>
Status: CLOSED EOL QA Contact: Ivo Bek <ibek>
Severity: medium Docs Contact:
Priority: high    
Version: 6.1.0CC: kverlaen, mbaluch, smcgowan
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-27 19:46:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marco Rietveld 2015-01-21 15:37:25 UTC
Description of problem:

Paging is possible with the REST rich Task query, like this: 

http://localhost:8080/business-central/rest/query/runtime/task?processinstanceid_max=5&s=4&p=0

This retrieves the first four elements related to tasks that have process instance id's that are less than or equal to 5. 

However, the paging for the rich Task query operation is currently done in-memory as opposed to via the SQL query. First, the entire dataset related to the criteria passed is retrieved to the database after which the paged information is retrieved. 

This is inefficient and not performant. 

Version-Release number of selected component 6.1.0

How reproducible:

Always

Steps to Reproduce:
1. Create a large dataset (10000+ processes, each with multiple tasks)
2. Do a REST rich task query using pagination (page number and page size) 

Actual results:

The result will take longer than it should. 

Expected results:

The result will return within an acceptable time

Additional info:

See https://github.com/droolsjbpm/droolsjbpm-integration/blob/8343c93f6367e2724e6f85daa733175687530d7a/kie-remote/kie-remote-services/src/main/java/org/kie/remote/services/rest/query/InternalTaskQueryHelper.java#L71

Comment 1 Marco Rietveld 2015-01-21 15:38:24 UTC
This is related to https://bugzilla.redhat.com/show_bug.cgi?id=1174885