rendered paste body
mysql> SELECT m.ID_TOPIC FROM yabbse_topics_current AS t LEFT JOIN yabbse_messages_current AS m ON (m.ID_MSG=t.ID_LAST_MSG) WHERE t.ID_BOARD=
48 ORDER BY m.posterTime DESC LIMIT 1;
+----------+
| ID_TOPIC |
+----------+
| 87622 |
+----------+
1 row in set (49.45 sec)
mysql> SELECT count(*) FROM yabbse_topics_current;
+----------+
| count(*) |
+----------+
| 23112 |
+----------+
1 row in set (0.00 sec)
mysql> SELECT count(*) FROM yabbse_messages_current;
+----------+
| count(*) |
+----------+
| 1249702 |
+----------+
1 row in set (0.00 sec)
mysql> desc SELECT m.ID_TOPIC FROM yabbse_topics_current AS t LEFT JOIN yabbse_messages_current AS m ON (m.ID_MSG=t.ID_LAST_MSG) WHERE t.ID_B
OARD=48 ORDER BY m.posterTime DESC LIMIT 1;
+----+-------------+-------+--------+---------------+---------+---------+-----------------------+-------+----------------------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+--------+---------------+---------+---------+-----------------------+-------+----------------------------------------------+
| 1 | SIMPLE | t | ALL | NULL | NULL | NULL | NULL | 23112 | Using where; Using temporary; Using filesort |
| 1 | SIMPLE | m | eq_ref | PRIMARY | PRIMARY | 4 | genteya.t.ID_LAST_MSG | 1 | |
+----+-------------+-------+--------+---------------+---------+---------+-----------------------+-------+----------------------------------------------+
2 rows in set (0.00 sec)
mysql> show create table yabbse_topics_current ;
+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| yabbse_topics_current | CREATE TABLE `yabbse_topics_current` (
`ID_TOPIC` int(11) NOT NULL auto_increment,
`ID_BOARD` int(11) NOT NULL default '0',
`ID_MEMBER_STARTED` int(11) NOT NULL default '0',
`ID_MEMBER_UPDATED` int(11) NOT NULL default '0',
`ID_FIRST_MSG` int(11) NOT NULL default '0',
`ID_LAST_MSG` int(11) NOT NULL default '0',
`ID_POLL` int(11) NOT NULL default '-1',
`numReplies` int(11) NOT NULL default '0',
`numViews` int(11) NOT NULL default '0',
`locked` tinyint(4) NOT NULL default '0',
`notifies` text,
`isSticky` tinyint(4) NOT NULL default '0',
PRIMARY KEY (`ID_TOPIC`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)
mysql> show create table yabbse_messages_current ;
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| yabbse_messages_current | CREATE TABLE `yabbse_messages_current` (
`ID_MSG` int(11) NOT NULL auto_increment,
`ID_TOPIC` int(11) NOT NULL default '0',
`ID_MEMBER` int(11) NOT NULL default '0',
`subject` tinytext,
`posterName` tinytext NOT NULL,
`posterEmail` tinytext,
`posterTime` bigint(20) default NULL,
`posterIP` tinytext NOT NULL,
`smiliesEnabled` tinyint(4) NOT NULL default '1',
`modifiedTime` bigint(20) default NULL,
`modifiedName` tinytext,
`body` text,
`icon` tinytext,
`attachmentSize` mediumint(9) NOT NULL default '0',
`attachmentFilename` tinytext,
PRIMARY KEY (`ID_MSG`),
KEY `ID_TOPIC` (`ID_TOPIC`),
KEY `ID_MEMBER` (`ID_MEMBER`),
KEY `posterTime` (`posterTime`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.02 sec)
mysql>