News for hackers. Stuff that matters.
Re:MySQL - Do Not Pass This Way Again by mscarborough on Saturday January 26, 2013 @10:10PM (#5122883)
This person doesn't even offer a solution?

How is it that people who have blogs that take 30 seconds to load continue to give performance advice that gets upvoted?

The funny thing is that this blog's performance is based on some cookie. If I reload in Chrome? 2 sec. If I reload in "Incognito Chrome", it's again really slow.

So seriously, just stop with these authoritative blog posts when you don't even know what you're talking about.

Re:MySQL - Do Not Pass This Way Again by jacques_chester on Saturday January 26, 2013 @10:38PM (#5122947)
It's not performance advice, though.

It's a list of known problems with MySQL, most of which violate the "Principle of Least Surprise".

Some of the problems have performance implications. The query planner stuff, for example.

> The funny thing is that this blog's performance is based on some cookie. If I reload in Chrome? 2 sec ... just stop ... when you don't even know what you're talking about.

It may interest you to learn that web browsers have local caches. Incognito Mode does not have such a cache, and so must refetch pages from scratch on each view.

Re:MySQL - Do Not Pass This Way Again by mscarborough on Saturday January 26, 2013 @10:46PM (#5122962)
If you have to be a jerk about it, it may interest you that relatively static blog content can be cached on the server.

I'm genuinely interested to learn which use cases are more dependent on query planning than caching methodologies.

Re:MySQL - Do Not Pass This Way Again by jacques_chester on Saturday January 26, 2013 @10:57PM (#5122981)
> I'm genuinely interested to learn which use cases are more dependent on query planning than caching methodologies.

I'll reply to this separately, it's a good discussion to have.

My basic problem is that caching comes with a coordination cost and I prefer the originating data source to be as performant as possible.

My own use case is a small Wordpress multisite installation. Even with a relatively trivial amount of traffic and site data, it behaves abysmally on some simple requests. The linked article seems to explain why -- the query planner ignores indexes on certain kinds of joins. The same sort of joins as the Wordpress Recent Comments Widget.

Now, I can and have worked around this by using multiple layers of caching. There's the MySQL query cache, some memcache (PHP opcode caches would in theory be quicker but I've never been satisfied with their stability) and of course pumping gzipped HTML to disk for nginx to serve directly without hitting PHP or MySQL.

But like I said, caching comes with a coordination cost. One of my sites is used less like a blog and more like a chat room. Hundreds of comments per hour, every single one of which causes the query cache to be pruned of the exact query I most need to cache in the first place.

That is: I need to cache this query because they talk so much. But they talk so much that the cache is not that helpful.

What would be helpful is if MySQL was a bit smarter about using the indexes I put there in an apparently useless bit of chicken-waving.

Re:MySQL - Do Not Pass This Way Again by mscarborough on Saturday January 26, 2013 @11:28PM (#5123061)
As you described it, the query/caching strategy sounds too complicated.

mysql proxy might help you out, or mysql triggers, or plenty of easy indexing strategies.

i agree, caching strategies are not easy, but that is not the fault of databases. IMHO keeping your data layers separate is best.

if you have a multi-site installation, set some kind of prefix within the app that makes sense to you for each application, before it goes into whatever cache.

this will work for you whether it is shared memory, memcached, or some kinda file situation.

Re:MySQL - Do Not Pass This Way Again by zorlem on Sunday January 27, 2013 @07:02AM (#5123971)
> As you described it, the query/caching strategy sounds too complicated.

But that was his whole point - needlessly complicating an otherwise simple setup to get around limitations in the DB engine.

> mysql proxy might help you out, or mysql triggers, or plenty of easy indexing strategies.

I genuinely fail to see how mysql-proxy [1] (which has a sleuth of long-standing, unfixed, problems on its own), or triggers would (elegantly) help in this situation.

[1] http://dev.mysql.com/doc/refman/5.1/en/mysql-proxy.html

edit: formatting

Re:MySQL - Do Not Pass This Way Again by knightni on Sunday January 27, 2013 @03:55AM (#5123698)
...or he could use a dbms that works properly and save himself the hassle.
Re:MySQL - Do Not Pass This Way Again by EugeneOZ on Sunday January 27, 2013 @08:58AM (#5124265)
> But like I said, caching comes with a coordination cost.

And what? It's the reason to not use caching? ridiculous

Re:MySQL - Do Not Pass This Way Again by jacques_chester on Saturday January 26, 2013 @10:49PM (#5122969)
> relatively static blog content can be cached on the server.

If you poke around, you'll find that this isn't a Wordpress installation. (Or any other dynamic blog engine, for that matter.)

It's Markdoc[1], a static site generator:

> Markdoc converts wikis into raw HTML files and media ... Markdoc need not be installed on the hosting site, since the resultant HTML is completely independent.

I believe the program at fault here is Apache, which in the default configuration loves nothing better than to choke on child processes.

[1] http://markdoc.org/

Re:MySQL - Do Not Pass This Way Again by fdr on Saturday January 26, 2013 @10:20PM (#5122901)
When criticizing a piece of software as popular as MySQL, offering a solution is an exercise in futility: it only leads people to think that the author is wrong because the alternative posited is wrong for them. See the endless MySQL vs. PostgreSQL discussions (which are not entirely without merit: the two system do have overlap in targeted users).

Instead, this author his simply focused on numerous detailed aspects of MySQL that he/she seems to think would be seen by most people as particularly insane, without need for comparison. I think there's a place for that.

Re:MySQL - Do Not Pass This Way Again by mscarborough on Saturday January 26, 2013 @10:33PM (#5122939)
You're right, offering a solution to MySQL problems in a thread is generally useless.

I don't really get what point the author is trying to make.

I also don't take detailed performance advice from people who can't keep a blog up. Yeah, must be the wrong backend.

Re:MySQL - Do Not Pass This Way Again by willlll on Saturday January 26, 2013 @10:35PM (#5122942)
How could you possibly not get the point? It's the first two (2) sentences "Considering MySQL? Use something else."
Re:MySQL - Do Not Pass This Way Again by stef25 on Sunday January 27, 2013 @03:35AM (#5123669)
I used Postgres on a project and my main concern with it is that whatever GUIs were available were seriously lacking. Phppgadmin is awful.

If you're really pushing its capabilities then there may be better solutions than MySQL but for bog standard applications and websites there is no alternative as far as I'm concerned.

Re:MySQL - Do Not Pass This Way Again by zorlem on Sunday January 27, 2013 @06:58AM (#5123965)
You should've used pgAdmin [1], it's much better than PhpPgAdmin [1]. I have not used the MySQL GUI (MySQL Workbench [2])that Oracle/Sun/MySQL sells with the Enterprise license but by its feature list I suspect that it provides comparable functionality to pgAdmin (which is FOSS). I would not put any of Php{Pg,My}Admin interfaces in the same category - they're too lacking IMO.

[1] http://www.pgadmin.org/

[2] http://www.mysql.com/products/workbench/

Re:MySQL - Do Not Pass This Way Again by robertfw on Sunday January 27, 2013 @02:38PM (#5125310)
I'll second pgadmin. I finally woke up to the fact that I should start using Postgres a few months ago, and pgadmin made my initial foray into postgres very straight forward
Re:MySQL - Do Not Pass This Way Again by mscarborough on Saturday January 26, 2013 @10:42PM (#5122954)
I use MySQL and Postgres, depending on the project.

What other option is so obvious that you can't even name it?

Re:MySQL - Do Not Pass This Way Again by ansgri on Sunday January 27, 2013 @08:54AM (#5124250)
SQLite is so obvious, and in many cases it's just enough. Or, hsqldb if you're into Java.
Re:MySQL - Do Not Pass This Way Again by mdellabitta on Saturday January 26, 2013 @10:33PM (#5122938)
This is an ad hominem argument. His statements about MySQL should be judged on their own merits, regardless of the load times of his blog.
Re:MySQL - Do Not Pass This Way Again by mscarborough on Saturday January 26, 2013 @10:36PM (#5122943)
No, it's not.

If you're going to be a performance authority about web technology, you should know how to configure the open-source and very well-documented code you are using.

Re:MySQL - Do Not Pass This Way Again by zorlem on Sunday January 27, 2013 @07:20AM (#5124010)
The OP is not trying to be "a performance authority about web technology", in fact the article's main focus in not on performance, but on peculiarities in the RDBMS engine that force the developers to constantly seek workarounds and be very careful about silent (and unexpected) behavior.

There is no "web technologies" in the article, the term "web" is found only once (!) in the whole text.

Re:MySQL - Do Not Pass This Way Again by jacques_chester on Saturday January 26, 2013 @10:41PM (#5122950)
I don't see how using Apache, with what I guess are the default settings, has any bearing on remarks about MySQL.
Re:MySQL - Do Not Pass This Way Again by mscarborough on Saturday January 26, 2013 @10:49PM (#5122968)
didn't say anything about apache, so not sure what you're complaining about.
Re:MySQL - Do Not Pass This Way Again by jacques_chester on Saturday January 26, 2013 @10:50PM (#5122970)
See my other reply for why I brought Apache into the discussion.
Re:MySQL - Do Not Pass This Way Again by mdellabitta on Sunday January 27, 2013 @08:43AM (#5124206)
And so you assume that the author of the article doesn't know how to optimize his or her blog, ignoring the possibility that he or she does, but didn't do it for intervening reasons.

Still has no bearing on the veracity of statements made in the article.

Re:MySQL - Do Not Pass This Way Again by lucian1900 on Sunday January 27, 2013 @05:45AM (#5123861)
Given such a detailed article, the solution is obviously another DB. Postgres lacks most of the MySQL flaws described.
Re:MySQL - Do Not Pass This Way Again by saosebastiao on Saturday January 26, 2013 @11:02PM (#5122997)
It took less than a second for it to load on my browser. And why should he offer a solution? The point of his rant isn't that you should use a particular solution, but rather that you should avoid MySQL at all costs.
Re:MySQL - Do Not Pass This Way Again by elchief on Saturday January 26, 2013 @11:20PM (#5123046)
the solution is Postgres