Transcript
It is an advisor that will help you potentially rewrite a query. It will also help suggest missing indexes, etc., and it appears in the AI Query Assist column within the web portal. So this is something that is unique to the web portal itself. In this case, we've already done an optimization for this one, so you can see that it is waiting there for our review. If you want to do a new one, these are the ones that have both a SQL statement as well as a plan that we can send to the AI engine. So to do that, and you click on a query, there is a new AI Query Assist tab in the bottom right, and you would just choose Optimize SQL. What happens under the covers then is that a sanitized version of your SQL statement, so the text data, as well as the plan, is sent up to our AI query engine, and in about a minute or so, it will come back with the results. So let's take a quick look at some examples of results. So I did this optimization a couple of days ago, and it's very small down here, so what I typically will do is maximize this screen, and then you get four different sections of things. The top one is the rewritten query, so here is the original, and then here is the optimized version of that. Now as with any AI engine, I never take it at first blush. I make sure and test it first of all, and make sure that it makes sense to me that I can maintain it, and I really take it as more of a suggestion, maybe some different ideas on how to rewrite the query. A lot of us get stuck writing queries the same way oftentimes, but this might be another option that you didn't think about previously. The other sections, the thinking section, it gives you a little bit about what it saw and what it will work on and improve potentially. The explanation is a detailed explanation of what it found and kind of what it suggested doing, including there will be some suggested indexes potentially here. And then there's also a summary too of what it would do. So it hopefully will provide maybe a different way of thinking about the query, but hopefully ways of rewriting the query so that it is more optimal.