标签:charset RoCE procedure sts round _id def table delay
CREATE TABLE `card` ( `card_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT ‘ID‘, `card_number` varchar(100) DEFAULT NULL COMMENT ‘卡号‘, PRIMARY KEY (`card_id`) ) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC
DROP PROCEDURE IF EXISTS proc1; DELIMITER $$ SET AUTOCOMMIT = 0$$ CREATE PROCEDURE proc1() BEGIN DECLARE v_cnt DECIMAL (10) DEFAULT 0 ; dd:LOOP INSERT INTO card (card_number) VALUES (UUID()); COMMIT; SET v_cnt = v_cnt+1 ; IF v_cnt = 10000000 THEN LEAVE dd; END IF; END LOOP dd ; END;$$ DELIMITER ;
3.调用存储过程,生成对应的测试数据
call proc1;
4.来测试一下性能吧。
select * from card order by rand() limit 1; //6.5秒查询完毕 select * from card where card_number like ‘%xxx%‘; //3.7秒查询完毕
标签:charset RoCE procedure sts round _id def table delay
原文地址:https://www.cnblogs.com/gmin/p/10955709.html