I have pasted below some queries and a table structure that I am finding to be very slow.
As you can see, if I or the two keyed fields, the query takes ~7 seconds. If I just run them by themselves, it takes no measurable time. Is this something we just have to live with? Or, is there something wrong? Brian. ================================================= mysql> update forum set approved='N' where id=644122 or thread=644122; Query OK, 0 rows affected (6.79 sec) Rows matched: 1 Changed: 0 Warnings: 0 mysql> update forum set approved='N' where id=644122; Query OK, 0 rows affected (0.00 sec) Rows matched: 1 Changed: 0 Warnings: 0 mysql> update forum set approved='N' where thread=644122; Query OK, 0 rows affected (0.00 sec) Rows matched: 1 Changed: 0 Warnings: 0 mysql> select count(*) from forum; +----------+ | count(*) | +----------+ | 547989 | +----------+ 1 row in set (0.00 sec) CREATE TABLE `forum` ( `id` int(10) unsigned NOT NULL default '0', `datestamp` datetime NOT NULL default '0000-00-00 00:00:00', `thread` int(10) unsigned NOT NULL default '0', `parent` int(10) unsigned NOT NULL default '0', `author` char(37) NOT NULL default '', `subject` char(255) NOT NULL default '', `email` char(200) NOT NULL default '', `host` char(50) NOT NULL default '', `email_reply` char(1) NOT NULL default 'N', `approved` char(1) NOT NULL default 'N', `msgid` char(100) NOT NULL default '', `modifystamp` int(10) unsigned NOT NULL default '0', `userid` int(10) unsigned NOT NULL default '0', PRIMARY KEY (`id`), KEY `author` (`author`), KEY `userid` (`userid`), KEY `datestamp` (`datestamp`), KEY `subject` (`subject`), KEY `thread` (`thread`), KEY `parent` (`parent`), KEY `approved` (`approved`), KEY `msgid` (`msgid`), KEY `modifystamp` (`modifystamp`) ) Brian Moon ------------------------------------------------------------------------- Phorum Dev Team - http://phorum.org Making better forums with PHP ------------------------------------------------------------------------- --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php