AryanVBW commented on PR #2832: URL: https://github.com/apache/kvrocks/pull/2832#issuecomment-2730035243
> Hey @AryanVBW , this PR looks like a good starting point, but it’s missing a some of the key parts to be a functional KQIR optimizer. > > There’s no actual equality saturation algorithm, the rewrite rules don’t do anything yet, the cost model is just a placeholder, and it’s not integrated with Kvrocks' query engine (this can be done later ig). Plus, without tests or benchmarks, we can’t validate if it actually improves anything. I’d suggest making this a draft PR and continuing work on it, or creating a separate branch where we can properly develop it before merging. > > To the best of my knowledge, this is going to be much more complex than standard SQL parsing. I’d recommend checking out some existing articles like [KQIR: a query engine for Apache Kvrocks](https://kvrocks.apache.org/blog/kqir-query-engine/) to get better understanding of how query optimization works in Kvrocks. A good next step would be to experiment with combining multiple operations like `SCAN`, `ZRANGE`, and `GET`. The optimizer can then use egraphs to explore different ways to merge or reorder these operations, in the end finding the most efficient execution path. > > A really good resource: https://egraphs-good.github.io/ Very interesting introduction to egraphs: https://www.cole-k.com/2023/07/24/e-graphs-primer/ Thank you, sir. I really appreciate your detailed feedback and guidance. I truly enjoy working on this, and I understand that there’s still a lot to refine. I’ll start by creating a separate branch to continue developing a proper KQIR optimizer, ensuring that key components like equality saturation, rewrite rules, and cost models are implemented correctl I'll also spend some time reading the recommended materials to learn more about query optimization in Kvrocks. I'm looking forward to gradually improving this. Once again, I appreciate your help! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
