support dynamic queries. A dynamic query is one where the list of ids to
consider is dynamically provided. The main limitation of this approach is that
results are sorted based on the order of these ids. Furthermore, dynamic queries
can't be optimized for cases where the sort is much larger than one of the filters.