MySQL Procedure Analyse – optimising data types

Welcome back to TopSecretProject.

The MySQL Performance Blog has another gem in the form of MySQL’s Procedure Analyse function.

Procedure Analyse helps you find the optimal data type for the column values in a table.

Usage is very simple:

SELECT … FROM … WHERE … PROCEDURE ANALYSE([max_elements,[max_memory]])

A range of statistics and recommended data types and are returned for each column in your table.

For more information see the MySQL Docs on using Procedure Analyse.

CloudKit, pondering the future

I ponder the future and trawl the web.

Recently in my travels I found the awesome CloudKit.

CloudKit provides schema-free, auto-versioned, RESTful JSON storage with optional OpenID and OAuth support, including OAuth Discovery.

Cloudkit is similar in some respects to CouchDB – date is stored in JSON, access via REST.

I looked at CouchDB in some detail for a project I have in the works and was very impressed with it’s capabilities, particularly the ability to query the datastore using JavaScript and a Map/Reduce algorithm.

In the end, I have decided that the benefits of persisting* with MySQL (or PostgreSQL) are too great to abandon relational technology just yet – the Rails ecosystem has such good support for these technologies in Active Record.

* And yes, pun intended.