Have you ever wanted to put a query to sleep for a while on a running database? Maybe to test client software to see how they behave when a long running query is submitted?
Since MySQL 5.0.12, a new function was added that lets you do just that. Aptly named sleep( seconds )
select sleep( 30 );
This will put the query to sleep and only wake up on an interupt or when the time elapses.
http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html
PostgreSQL has also added this in 8.2 (currently in beta) but under the
guise of the pg_sleep function.
SELECT pg_sleep(10);