Xaprb

Stay curious!

Archive for the ‘SQL’ Category

New translations of High Performance MySQL

with 8 comments

High Performance MySQL, 3rd Edition has been selling very well. It’s translated into many languages. O’Reilly sends me a hard-copy of the translations, and I have a whole section on my bookshelf dedicated to them. It’s really satisfying to look at it.

Today I’m happy to announce that we’re moving forward with a new batch of translations. Demand has been so strong that we want to make the book accessible to as wide an audience as possible. Plus, I get a fat check every time O’Reilly sells the translation rights.

The new languages will include Australian, l337 (“Leet”), Jive, Ebonics, Elmer Fudd, Blissymbols, and Esperanto. Here’s a sample before-and-after paragraph:

Isolating the Column

We commonly see queries that defeat indexes or prevent MySQL from using the available indexes. MySQL generally can’t use indexes on columns unless the columns are isolated in the query. “Isolating” the column means it should not be part of an expression or be inside a function in the query.

Here’s the same passage, translated to Australian:

˙ʎɹǝnb ǝɥʇ uı uoıʇɔunɟ ɐ ǝpısuı ǝq ɹo uoıssǝɹdxǝ uɐ ɟo ʇɹɐd ǝq ʇou plnoɥs ʇı suɐǝɯ uɯnloɔ ǝɥʇ ”ƃuıʇɐlosI“ ˙ʎɹǝnb ǝɥʇ uı pǝʇɐlosı ǝɹɐ suɯnloɔ ǝɥʇ ssǝlun suɯnloɔ uo sǝxǝpuı ǝsn ʇ’uɐɔ ʎllɐɹǝuǝƃ ˥QSʎW ˙sǝxǝpuı ǝlqɐlıɐʌɐ ǝɥʇ ƃuısn ɯoɹɟ ˥QSʎW ʇuǝʌǝɹd ɹo sǝxǝpuı ʇɐǝɟǝp ʇɐɥʇ sǝıɹǝnb ǝǝs ʎluoɯɯoɔ ǝM

uɯnloƆ ǝɥʇ ƃuıʇɐlosI

And here’s the sample in Jive:

Them Columns Cut a Lemon fo Isolatin’

Ain’t nothin but a thang bout them messin’ up my old lady’s indexes cain’t be runnin’ upside down yo’ head. Slap my fro. MySQL can’t dig it with lay no indexes on dem less’n you gets ‘em say I won say I pray I get the same ol’ same ol’. Yo SQL, MySQL, all them SQL. What it is, Mama, what it is. Knock yoself a pro slick, get ‘em spreshuns ain’t be togetha. Use yo’ gray mattah! True dat, git it out wid de functions. Come on got to be! Sheeeeeeeh.

There may be some rough edges, of course. This is only an early draft.

In addition, we are translating the technical examples and code samples into additional computer languages, including popular ones like LOLCATS, ALGOL (sorry, not the latest release — that will come soon), and even obscure languages like Node.JS and Commodore 64. We’re also extending the book with compatibility plugins — sort of “skins” or “personalities” if you will — that will let you apply all the knowledge in the book to irrelevant, obscure database servers like Oracle, PostgreSQL (a.k.a. “Postgre”), Riak, and FAT32.

Your feedback and suggestions are welcome. Let me know if there’s anything I can do to help make your High Performance MySQL experience more enjoyable. Or, if you prefer: Slide your jib, brother sky, don’t be sayin’ no off-time jive, lay it on, you dig? Mash me a fin.

Written by Baron Schwartz

March 31st, 2013 at 10:01 pm

Posted in PostgreSQL,SQL

Building MySQL Database Applications with Go

with 7 comments

Last night at the Golang-DC meetup I spoke about building (MySQL) database applications with Go. The meetup was well attended and people were very enthusiastic about Go. I spent a few minutes talking about Go in general, how VividCortex uses Go (we’ve built our agents, API servers, and all backend processes with Go), why we like it, some of the nice things it enables like making it easy to build very resilient programs, and then I gave the presentation, which I’ve embedded below.

Afterwards the discussion ranged to a lot of related topics. This was the best part of the evening for me. There were really great questions on a variety of topics, and insightful answers from everyone.

Written by Baron Schwartz

March 20th, 2013 at 9:40 am

Posted in Coding,Go,SQL

WordPress and MySQL’s strict mode

with 3 comments

I really don’t like running my database in “I Love Garbage” mode, so I set the following SQL_MODE:

STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO, NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE, NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY

Guess what WordPress does with that? It doesn’t install. If you set the SQL_MODE to empty and install WordPress, then restore the SQL_MODE, WordPress will run, but if you try to create a post you’ll see an error page that says “You are not allowed to edit this post.”

This problem was reported to WordPress at least 7 years ago. Lessons learned:

  • There is a huge amount of software that was built to work with MySQL 3.23′s irritating habit of inserting different data than you told it to, with nothing but a warning most people will never see.
  • That software will break in unlovely ways when you try to make MySQL behave more correctly.
  • Those who gripe about MySQL’s bugs (as I sometimes do) should remember that MySQL is probably better quality than most of the software that is built to use it. This is probably a universal truth — the Linux kernel is probably better quality than most software that runs in Linux, for example.
  • MySQL’s bugs often get fixed faster than aforementioned software’s bugs, too.

Written by Baron Schwartz

March 15th, 2013 at 2:50 pm

Posted in SQL