TaskService query very slow even for small amount of data

Hi and Welcome to the Forum

Are you also following (or perhaps working with the poster from) this thread

What is your environment? Camunda Run? Camunda 7 with External Tasks? Are you using the embedded H2 database or some other DB?