how to add a key into query ?

Hi expert.

Recently I found there is a good object "Query" in Navision 2016. , there isn't such object in 2009.

But what I am worried about is the performance of it. I can combine header and line table easily, but if there is a method to create a key Or "index" ?

any suggestion will be warmly appreciated.