I have a kusto query which takes some time to run, and I run the query frequently, but I don't need the data to be fresh. Is there a way to set it up so the query runs automatically once every 6 hours, the results are cached and I can just fetch the cached results so I'm not stressing my Kusto DB?
For ease of use I have the query set up as a stored function which I can just call as MyFunction(with various parameters)
there are a few options to implement this:
using the query results cache, with a tolerance of up to 6 hours of freshness. this could work if the total size of the result set is small enough, and no other workloads are competing for the same resource: https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/query-results-cache
persisting the results of the query into a table in the background periodically (using a .set-or-replace
command), and then querying that table directly: https://learn.microsoft.com/en-us/azure/data-explorer/kusto/management/data-ingestion/ingest-from-query
using stored query results: https://learn.microsoft.com/en-us/azure/data-explorer/kusto/management/stored-query-results
of the above options, and given your description, I'd suggest starting with option #2 and seeing if that works for your use case