Is there a way we can execute sql query on the result obtained by running a second sql query on ignite cache? I have a huge dataset that needs to be filtered first based on some inputs. Once I have the filtered smaller set, I need to perform operations like calculating average, min, max, sum, standard deviation, etc. As of now, I am writing separate sql queries for all these operations but filtering is taking time which I don't want to avoid repeating. Any suggestions?
1 Answer
To run SQL query, you need to have data in the cache. Having said that, you can execute the first query and store the result in another cache, and then query this cache with the second query. This will increase memory consumption, but you will be able to reuse the result of the first query.
2 Comments
Pooja Mazumdar
But wouldn't it increase latency? creating and pushing the results on another cache. I will check how much time it takes to do that and see whether this takes lesser time as compared to filtering repeatedly. thanks for your response Valentin.
Valentin Kulichenko
My understanding is that you want to reuse the result of the first query. It will take some time to create it, of course, but you will do this only once.