Scotty T has an great overview of how MySQL interacts with WordPress and is worth a review, especially if you’re entering into the WordPress airspace for the first time.
He really sums up the tension that exists between PHP developers and MySQL here:
You would be surprised how many people I have interviewed for a job that think their PHP chops are great, but their MySQL, not so much. Many great WordPress developers I know have said the same thing. Not cool. Bad SQL can bring down your site!
Forget crazy scaling challenges, basic WP Query usage can bring your site down if you aren’t careful. WordPress is a framework that provides you with a lot out of the box, but you are still going to end up writing a bunch of your own PHP to make it work the way you want. The same should be true, but often isn’t, for SQL queries.
As is usually the case, for basic usage (e.g. your mom’s blog), don’t mess with SQL. If you work on an enterprise-level site and have all kinds of monitoring and benchmarking tools in place, let’s mess with some SQL.
Many of us will never have to dive in too deeply to MySQL but for those that are looking at WordPress as an application framework you’re going to want to make sure that you have your database “chops” up to snuff.
Scott even goes into some optimization and caching near the end as well.
Again, for many WordPress developers who are serving their clients and customers with customized WordPress solutions, you won’t need to become a super-ninja-elite MySQL developer but it pays to know how you’re interfacing with the database so that your solution is developed in the best manner possible as well as have the ability to scale.
Because that’s what it’s all about at the end of the day for most of our clients/customers, right? The point of them paying us a lot of money is so that their brand and their company grows and specifically web traffic with their brand spankin’ new WordPress-powered site/blog.
So do them a favor and make the best WP Query choices as you possibly can.