Here is a way to get some random rows from MySQL:
mysql> SELECT id FROM record ORDER BY RAND() LIMIT 5;
It is apparently slow, but works fine for one-offs.
From the MySQL docs:
The default character set and collation are latin1 and latin1_swedish_ci, so nonbinary string comparisons are case insensitive by default.
... so if you were trying to do something like this:
SELECT * FROM thetable WHERE colname REGEXP '^[A-Z]';
... and you were wondering why you were getting back results where colname started with lowercase letters too, this is why! Try this instead:
SELECT * FROM thetable WHERE colname COLLATE latin1_bin REGEXP '^[A-Z]';
I don't like MySQL, I would recommend PostGreSQL over it any day. However we are often forced to use things we don't like (for example at our workplaces!) so here is some info to help tune MySQL for speed:
MySQL Tuner is a Perl script that gives you a list of recommendations on settings to change. It seems easy and sensible! Just run it and it asks for user/pass settings and then gives you a little report.
Django Python 960.gs Git Vim NetBSD Nginx
The author is a software engineer living in Australia. He sux at guitar, loves camping, doesn't like cake, does like coffee and is a lazy home brewer.
Help
Latest entries
*BSD Agile Apache Apple Athletics Beer Best-Practice Censorship Comedy Cool Crosswords Deployment Django English Exim Firefox Git Hardcore Health Interface irssi Javascript Jira Languages Linux Makefile Markdown Mathematics Mobile Broadband MySQL NetBSD nginx Nokia OSX Perl Photo Privacy Python Rant Requirements rsync Ruby Shell Slackware SQL SQLite SSH Standards Subversion Testing ThisBlog Vim VMWare (Fusion) VPN WDTEM X Yum zsh
Perldoc Output
Yum
Possum
Git's Index
Jira Project Keys
The Coffee Shop
Git GUI
It is more important...
Questioning Unix (and Other) File Times
The Frog King Photo
Rain Cloud Photo
rsync
Timezone
utf8 in your Perl
Theatre Ceiling Photo
Some problems are so complex...
Colours in your PAGER
zsh vared
zsh magic-equals and double-star
Funny Tweets
ChoppingBoard, Project365, RageQuit