3 ms·
> What makes MySQL so bad at handling queries? I have never worked with it personally, but it seems like a core feature of a database should be handling many co
by mschuster91 6y ago
> What makes MySQL so bad at handling queries? I have never worked with it personally, but it seems like a core feature of a database should be handling many concurrent requests
The software that is used to generate the queries. Inadequate indices, writes on each page load that lock shared tables...
- jamesponddotco 6y agoAs someone who has worked on WordPress hosting companies for over 10 years now, I feel obligated to add that many hosting companies do not optimize MySQL settings either, despite their marketing saying otherwise. In fact, the database layer is often forgotten when you talk optimization in the WordPress world — page cache is usually seemed as the holy grail, with MySQL left to fend for itself.
- smt88 6y agoIn defense of anyone managing WordPress, its database schema is not well-normalized or organized (last I checked, it still had something like 6 tables). That scenario (in general, not referring specifically to WP anymore) makes database indexing/optimization much more expensive at webhost scale, because you potentially have columns that range in size from empty to 1MB. That's why most WP users have gone deep down the rabbithole of view-level caching, because optimizing an uncached result is so much harder in that environment.
- jamesponddotco 6y agoOh, I agree, optimizing MySQL for WordPress is a constant battle, with plugins and themes not handling the uninstallation process at all, and leaving huge amounts of data inside the wp_options table with autoload = on, for example, or the expensive queries that WordPress itself make — Elasticsearch and object caching are big help on this one in particular. But if you call yourself a managed WordPress hosting company and your marketing material says your entire stack is optimized for WordPress, you should be held to higher standards than a shared hosting company like HostGator, for example.
- dsr_ 6y agoIf you render everything out and save it in cache, it mostly doesn't matter how terribly your database is performing until you start getting lots of comments.
- jamesponddotco 6y agoYou will still get a fair amount of cache misses, in which case, everything else in the stack being optimized will save your ass. I am not saying that implementing page cache is bad — it is essential for WordPress —, just that page cache is not the only thing that matters, but seems to be the go-to solution for performance issues with WordPress, when in reality, you should look at the picture as a whole.