Taming the Open-Source DB: MySQL in a Nutshell by Russell J.T. Dyer

Author: DrPatPublished: May 31, 2005 at 8:55 pm 1 comment

By its own reckoning, MySQL Database Server is "the world's most popular open source database." Searches are swift, and the architecture makes it easy to customize. The server and storage engine are separate, which "makes it possible to run with strict transaction control or with ultra-fast transactionless disk access, whichever is most appropriate for the situation." And being open source, a GPL-licensed version is available for free online. From its initial adoption by Linux users, the database server has begun to make inroads on the marketplace dominated by Oracle and MS SQL. MySQL AB averages around 35,000 downloads of their software every day.

You get the program free, true—but manuals and tutorials come at a charge, as does the enterprise-level product. Even with the utilities that come bundled with MySQL, though, it's hard to keep all of its possibilities in mind. That's where Russell Dyer comes in. With MySQL in a Nutshell, Dyer has provided the perfect desk reference for this powerful DB engine.

This is not a book to learn database management from, nor is it a tutorial for building MySQL applications. There are plenty of helpful tutorials for those purposes, after all. The need that Dyer's book answers is the midnight-oil-burning, "how the heck do I analyze tables again? And are they delineated with commas or semicolons?" kind of question. You know the ones I mean; if you answer right, you get to go home and sleep with your spouse for a few hours—but answer wrong, and you'll still be sweating over the database when the day shift arrives.



ANALYZE TABLE

ANALYZE [LOCAL|NO_WRITE_TO_BINLOG] TABLE table[, ...]

Use this statement to analyze and store the key distribution of a table. It works on BDB, InnoDB,and MyISAM tables. Unless the NO_WRITE_TO_BINLOG option is given, the statement is written to the binary log file. The LOCAL option is synonymous.

ANALYZE TABLE workreq;

+--------------------+-------+--------+--------+
|Table               |Op     |Msq_type|Msg_text|
+--------------------+-------+--------+--------+
|workrequests.workreq|analyze|status  |OK      |
+--------------------+-------+--------+--------+


The message type results can be status, error, info or warning. If the table hasn't changed since it was last analyzed, the message text will read, "Table is already up to date" and the table won't be analyzed. This statement is equivalent to using myisamchk -a at the command line for MyISAM tables.

There is a quick list of installation instructions for various operating systems (a couple of pages each), followed by a brief (15-page) introduction to MySQL, then Dyer launches into the command syntax and purpose of the multitude of MySQL options. Entries are separated into chapters by type:

  • SQL Statements
  • String Functions
  • Date and Time Functions
  • Aggregate and Mathematical Functions
  • Flow Control Functions
  • Miscellaneous Functions
  • MySQL Server and Clients
  • Command-Line Utilities
  • Perl API
  • PHP API
  • C API

As you can see from the list, the entries cover everything that might be a challenge in managing or using MySQL. But just to make absolutely sure, Dyer includes several appendices that define datatypes, operators and environment variables. Tables scattered throughout the book list the nuances of option switches and parameters, essential for statements and functions with more than one or two choices.

Continued on the next page Page 1 — Page 2

Article tags

Spread the word
Bookmark and Share
Profile image for drpat

Article Author: DrPat

DrPat is the blog signature used by an old coot who hoards books, dances Argentine Tango, cooks a mean venison chili, and is happy to be along for the sag while my spouse does a marathon bicycle ride. …

Visit DrPat's author pageDrPat's Blog

Read comments on this article, and add some feedback of your own
  • No image found
  • No image found
  • No image found
  • No image found
  • No image found

Article comments

  • 1 - open source db

    Jul 24, 2009 at 7:18 am

    No doubt mysql is one of best database.

Add your comment, speak your mind

Personal attacks are NOT allowed.
Please read our comment policy.
Please preview your comment.

blogcritics lists for May 22, 2013

fresh articles Most recent articles site-wide

fresh comments Most recent comments site-wide

most comments Most comments in 24hrs

top writers Most prolific Blogcritics for April

top commenters Most prolific Commenters in 24 hrs