I'm trying to write a paged query that queries all 'ArticlePage' in the /Articles path in the content tree where the ArticlePage type is linked to a ArticleContent reusable content type and limited by a ArticleContentType Taxonomy.
Where I am stuck is that I first need to query the ArticleContent to get a list of ContentItemIDs to pass into the Linking method. However, even if I limit this just to the ID column it will still retrieve thousands of records making it inefficient. If I try to use the page size to limit the results of the query on the ArticleContent, then it is possible to get a result set that is less than the page size because whilst the Content Item is published the actually ArticlePage is not published.
I looked at the Community Portal (https://github.com/Kentico/community-portal/blob/main/src/Kentico.Community.Portal.Web/Features/Blog/Operations/BlogPostsByTaxonomyQuery.cs) as a basis.