关闭

集群速度问题

830人阅读 评论(2) 收藏 举报

CREATE TABLE `urllog` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `url` varchar(435) NOT NULL DEFAULT '',
  `create_time` datetime NOT NULL,
  `groupid` int(11) DEFAULT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=ndbcluster DEFAULT CHARSET=utf8


ndb_mgm> show
Cluster Configuration
---------------------
[ndbd(NDB)]     2 node(s)
id=2    @192.168.1.16  (Version: 5.1.21, Nodegroup: 0, Master)
id=3    @192.168.1.19  (Version: 5.1.21, Nodegroup: 0)

[ndb_mgmd(MGM)] 1 node(s)
id=1    @192.168.1.79  (Version: 5.1.21)

[mysqld(API)]   1 node(s)
id=4    @192.168.1.76  (Version: 5.1.21)

 


mysql> select * from urllog order by id desc limit 10;
+---------+--------------------------------------------------------------------------+---------------------+---------+
| ID      | url                                                                      | create_time         | groupid |
+---------+--------------------------------------------------------------------------+---------------------+---------+
| 6665000 | 24A4FEAE-C03C-4812-92C8-95F897B4B4BFFECFF505-1CA3-4CBD-9973-498F72D126EF | 2007-09-10 17:18:02 |    NULL |
| 6664999 | 9F78EDC2-B6B5-46C8-AB96-51163DCA97AD98C20E4A-EC46-4346-A49E-E58606DB8E63 | 2007-09-10 17:18:02 |    NULL |
| 6664998 | AF8380D3-D981-45D7-869D-C27F11C5AEA67B9DDB33-9D44-485F-9324-501E1756DE07 | 2007-09-10 17:18:02 |    NULL |
| 6664997 | 77F3E385-E51D-43FC-AAC6-2C7800777514DB4449F6-A6C7-4121-8151-D1D8F6838954 | 2007-09-10 17:18:02 |    NULL |
| 6664996 | 5E62CEF1-393C-4C22-8A36-07E3216A3ECF529312C2-1BA3-46C5-9E0B-BC98DF628319 | 2007-09-10 17:18:02 |    NULL |
| 6664995 | 7B5CED98-BF92-40DD-AEFF-8E916C3CA72993276733-D783-4B42-973E-3FF9DBFE7ACC | 2007-09-10 17:18:02 |    NULL |
| 6664994 | 2D7D4AFE-5DF7-4328-AC0D-0CAF5B36B90D9B1A7CC3-2751-46F0-897D-1BCCB1B77F13 | 2007-09-10 17:18:02 |    NULL |
| 6664993 | BE7D1713-3C45-4C04-82EA-D4D40C2258F59FCC0E29-646D-49B4-92EB-2E0811769DDC | 2007-09-10 17:18:02 |    NULL |
| 6664992 | 6977E64C-D803-44F7-90D8-98557CE615299F327E89-D9FC-4803-BE49-9E0CB9CF8C1B | 2007-09-10 17:18:02 |    NULL |
| 6664991 | 16535A8D-2E8D-4464-A133-56CBE2F11D84AAA90EF6-8D5D-417E-8FA5-4D4FC466F77F | 2007-09-10 17:18:02 |    NULL |
+---------+--------------------------------------------------------------------------+---------------------+---------+
10 rows in set (0.01 sec)

mysql> select count(*) from urllog;
+----------+
| count(*) |
+----------+
|  1124607 |
+----------+
1 row in set (0.00 sec)

 

 

 

mysql> select length(url) l ,count(*) c from urllog group by l order by c desc limit 10;
+----+--------+
| l  | c      |
+----+--------+
| 72 | 659375 |
| 44 | 139094 |
| 57 |  81129 |
| 47 |  55902 |
| 43 |  46841 |
| 55 |  24807 |
| 59 |  17602 |
| 48 |  10642 |
| 41 |   7889 |
| 56 |   6968 |
+----+--------+
10 rows in set (2 min 27.79 sec)


百万数据量上面就会出现这么慢的问题,难道我有什么没有设置成功?
 

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:503205次
    • 积分:6740
    • 等级:
    • 排名:第3610名
    • 原创:166篇
    • 转载:66篇
    • 译文:1篇
    • 评论:80条
    文章分类
    最新评论