Posts

Does Artificial Intelligence Query MySQL Better Than You?

Image
 The signal-to-noise ratio in the hype for Artificial Intelligence is incredibly high. There are many claims that AI will replace software developers. Many years ago, developers were told to find other jobs as a new programming language was designed to be written by nonprogrammers, replacing expensive coders. The Common Business Orientated Language, or COBOL, was a big hit and is still very popular in some sectors. But it did not replace programmers. But can an AI write Structured Query Language (SQL) as well for use with MySQL, or better than you?  I decided to use the MySQL World and Sakila databases because they have been around for decades. Nearly everyone who has had tangential exposure to MySQL has used them, and their tables are easy to understand. These tried and true schemas have been used for documentation, blogs, webinars, and demos for years, so I had little doubt that some of that had been scraped and fed into the AI. I randomly picked Grok as the AI and will try ...

Tracking MySQL Query Plans Over Time Part One

 Did you ever need to determine the performance of a query over time? One of the problems with database query optimizations is that the underlying data is constantly churning. Add in an increase in the number of users, expanding server demand use, and other items that impact your query. What was optimized is no longer performing as expected. But how do you tell if there is a change in the query plan or the query performance? Well, the first step is gathering the needed information. MySQL added a JSON format option to the output of the EXPLAIN command quite a while ago. More recently, Oracle added the feature of saving the output into a variable (see https://dev.mysql.com/doc/refman/9.0/en/mysql-nutshell.html and https://dev.mysql.com/blog-archive/explain-into-and-explain-for-schema-in-mysql-81-and-82 ). This provides a way to access the data in that variable and plop it into a database. The saved result can be compared to current or other past responses for analysis.  mysql...