So I decided to try out the latest hot new thing with OpenAI ChatGPT.
Since I use SQL to query things related to Hive, I decided to ask for a tips how to improve one of my queries.
It is is a simple query..... here it is:
It gave me four tips!
Nice!
The use or no use of the NOLOCK statement is something I'm aware of, but I do it intentionally, since the database is being updated continuously as the chain goes.
Use index is also something I'm aware of, but till now the reading times for this query has been fast and there haven't been need to do it. I might implement it in some other queries though.
Using parameters, as example for dates, might be a good thing, but its not that hard for me to change it directly in the date section instead of having separate parameters where to change it.
Optimize the query. Arranging the lines in proper order might be useful and result in faster execution.
So there you go. You can now ask AI to give you coding tips and review your code!
The tips above are not essential for the query to work, but overall they are all good tips for implementing a proper working practices.
At least I know I haven't done some super dumb thing :)