Hi ,
Thanks for reaching out to Microsoft Q&A.
your query might be slow because it forces azure Data Explorer to perform a global sort across millions of rows, followed by serialization and row numbering for offset based pagination. This combination is very expensive in a distributed, columnar engine and explains both the high latency and memory usage. ADX can deliver sub second responses for user facing APIs, but only if the query patterns and data model are optimized for how the engine works. Instead of using offset pagination, you should switch to keyset (cursor-based) pagination, which avoids full scans and resorts on every request. Denormalizing freq joined attributes into your main fact table, either during ingestion or with a materialized view, also removes the overhead of joining at query time. Filtering early and projecting only the necessary columns will help reduce data shuffling and memory pressure. If joins with smaller tables are unavoidable hinting for broadcast joins/using lookups instead of full shuffles can improve performance somewhat.
Pls note that ADX is suitable for real time, low latency scenarios when queries are selective, aggregations are pushed down early, and pagination is designed to return only the top N rows efficiently. However if your use case demands deep offset paging with a global sort over tens of millions of rows, ADX or any columnar analytics store will struggle to meet a 1 - 2 second SLA. In such cases, you need to redesign the access pattern or use a different engine optimized for random access and offset pagination. For application facing APIs, rethink the experience to rely on incremental cursors and pre enriched data rather than complex joins and expensive sorts at query time.
Please 'Upvote'(Thumbs-up) and 'Accept' as answer if the reply was helpful. This will be benefitting other community members who face the same issue.