Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Case Analysis of the influence of mysql Index on sorting

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report