一个有 78 万数据的 mysql 表,创建索引 2 个小时了,还是未完成创建,是哪里不正常吗?

2020-04-08 19:31:01 +08:00
 css3

productName 列创建索引,创建前这个表已经有 78 万条数据

mysql> select count(id) from products;
+-----------+
| count(id) |
+-----------+
|    780097 |
+-----------+

| products | CREATE TABLE `products` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `productCode` text NOT NULL COMMENT '产品代码',
  `productName` text NOT NULL COMMENT '产品名称',
  `productLine` text NOT NULL COMMENT '产品线',
  `productScale` text NOT NULL,
  `productVendor` text NOT NULL,
  `productDescription` text NOT NULL,
  `quantityInStock` smallint(6) NOT NULL COMMENT '库存',
  `buyPrice` decimal(10,2) NOT NULL COMMENT '价格',
  `MSRP` decimal(10,2) NOT NULL COMMENT '建议零售价',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=760001 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC |

创建索引命令(卡这 2 个多小时了😱,这是在创建中还是已经凉了??):

mysql> create index product_index on products (productName(64));


7634 次点击
所在节点    MySQL
44 条回复
sdot96
2020-04-09 19:41:01 +08:00
换数据库引擎,然后建全文索引啊
EminemW
2020-04-10 01:33:58 +08:00
@b821025551b 应用层应该用啥,我用的是 Big Decimal
zhuzhibin
2020-04-10 09:30:41 +08:00
卡死应该是因为建立索引 mysql 进程卡死了
daya
2020-04-10 09:59:04 +08:00
你们已经把楼主吓得换头像了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/660565

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX