Somebody on nl.wikipedia.org ran this query:
SELECT user_name, COUNT(*) FROM user, cur, old WHERE user_name=old_user_text OR user_name=cur_user_text GROUP BY user_id ORDER BY user_id DESC LIMIT 20
This ran for about 90 minutes before I caught and killed it, and froze up the entire database in the meantime.
For those not familiar with SQL, the above query will take _every single_ article and cross-reference it against _every single_ stored old revision. It will then sort these _many millions_ of rows by user id and return the first 20. (Obviously that's not the intent, but that's how the database interprets the request.)
Sysop SQL queries on the database are now disabled. If people have an urgent need to perform queries and know what they're doing, we may be able to open up access on an individual basis, but please be aware that SQL offers many ways to shoot yourself in the foot. Allowing this access at all is a foolish thing that we do in the spirit of openness (like letting anyone edit our website ;) but we can't afford to have the site go down whenever somebody makes a typo.
-- brion vibber (brion @ pobox.com)
Brion-
Sysop SQL queries on the database are now disabled.
If I'm not mistaken, I had disabled them already. Why were they re- enabled? Sysop SQL queries are a bad, bad idea until we have timeouts. Yes, openness is good, but wikis work because users cannot do any lasting damage. Open SQL queries without timeouts are like a wiki without a page history.
Regards,
Erik
Brion Vibber wrote:
Somebody on nl.wikipedia.org ran this query:
SELECT user_name, COUNT(*) FROM user, cur, old WHERE user_name=old_user_text OR user_name=cur_user_text GROUP BY user_id ORDER BY user_id DESC LIMIT 20
Mea culpa.
At 01:44 PM 1/26/2004 -0800, Brion Vibber wrote:
Sysop SQL queries on the database are now disabled. If people have an urgent need to perform queries and know what they're doing, we may be able to open up access on an individual basis, but please be aware that SQL offers many ways to shoot yourself in the foot.
The only times I've ever used SQL queries have been as a way to do specialized searches of article text, for example a searching for strings or for specific wiki or HTML markup. Also to do searches with boolean terms. Would it be possible to create some sort of "power search" function that allows only "safe" SQL queries like that?