Search code examples
kqlazure-data-explorer

Query Optimization in KQL || Pagination


I have custom or Web UI where it fetches data from ADX streaming data. UI default fetch 20 records and if user want to see more records, scroll down and next 20 of records will be fetching from ADX and load into UI.

Below picture is UI, right hand side bottom, fetched records count vs total records count(60/6512), total record count is just number but the actual records not loaded, total number of record count come from query and just display for end user. when user scroll down each time query will submitted on ADX and process records and load into UI.

enter image description here

Below is Log analytics query logs, each time query is running and load into UI.

enter image description here

Please any KQL expert need your suggestion, How to overcome this issue.

Each time query has to process all the records and fetch only 20 records based on scroll down, we can't push all the records at a time because limitations on UI side or middle ware API.

How to over come this kind of issue? Any Query, Is it possible to load all 6512 records in one temp table and provide records to end user based on user scroll down, so query will not run each time, simply take from temp table until user session exists.

But UI is accessed by multiple users and use this UI to fetch records. not sure how to achieve performance on this.


Solution

  • One option is for you to use stored query results.

    That said, if the record count of the full result set is 6.5K, and assuming your client is running on a modern machine (e.g., its available RAM isn't measured in KBs), you might find it to be simpler to fetch the entire data set using one call, without sacrificing much.