Case Analysis of the influence of mysql Index on sorting
This paper gives an example of the influence of mysql index on sorting. Share with you for your reference, the details are as follows:
Indexes can not only improve query speed, but also add sorting speed, which will be improved if indexes are used in the statements that follow order by.
test
1. Create a test table: T15 table
CREATE TABLE `t15` (`id` int (10) unsigned NOT NULL AUTO_INCREMENT, `cat_ id` int (10) unsigned NOT NULL DEFAULT '0mm, `price` decimal (10Ling 2) NOT NULL DEFAULT' 0.005, `name` char (5) NOT NULL DEFAULT'', PRIMARY KEY (`id`),) ENGINE=InnoDB DEFAULT CHARSET=utf8
2. Insert 1W rows of data