Suggestion for faster response REST API


I have a suggestion for a faster response for rest calls that have a start 0 and a size smaller then 10.

Each call does two queries in the database. First it collects the data and then it does a count of the data.

Now I have a large historical dataset and one specific database query can take over 3000 ms.(eg. query/historic-process-instances with multiple variable matches) which means that the total time of the database queries for this rest call is over 6000 ms.

Now if the result of this 6 second call is smaller then 10 then I wouldn’t need the second database query. and the call would only take 3 seconds instead of 6.

What do you think of this idea?

thank in advance for your feedback.




Good suggestion, I will work to implement it like this.



great news!

Thanks Tijs!

Hi Yannick,

This should do the trick:

Could you check if this works for you?
It’s also committed to the flowable5 branch.

Best regards,


Hi Tijs,

This is exacly what I had in mind.

thanks a lot man!