Recently I’ve had to do some heavy-duty maintenance work on a MySQL database that’s still in heavy use, can’t take more than about 30 seconds of downtime, is having serious problems due to a 50 million row table that really needs trimmed down, but is missing the crucial indexes that would allow that to [...]

MySQL and Random

Filed Under MySQL | 1 Comment

Yesterday, when writing some tests involving data stored in MySQL, I was quite impressed to discover that I could add random data to the table by doing:
UPDATE table SET column = FLOOR(RAND() * 8) + 1;
I was originally worried that this would pick a random value and then assign it to every row, but no, [...]

V. Satheesh Babu has an interesting article on using Oracle Stored Procedures to add an extra layer of security to web applications.

Jeremy shows how to use spatial indexes in MySQL:

SELECT name
FROM map_test
WHERE Contains(GeomFromText(’POLYGON((0 0, 0 3, 3 3, 3 0, 0 0))’), loc) = 1;

Jeremy Zawody ably dissects the insanity that is the latest MySQL article on O’Reilly’s OnLamp. This article is written by one of the authors of O’Reilly’s latest book on MySQL, and has probably served to ensure that I don’t buy this book.
I’d add the following comments to Jeremy’s:
4. Don’t store binary data in MySQL
I [...]