Get the App
SLTechnology News&Howtos  ›  Database  › 

Case Analysis of the influence of mysql Index on sorting

Shulou Source: shulou.com Published: 2022-06-01 03:38:35 10月04日 Update

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

Tags: Index sort statement skill query speed data time analysis influence Daquan actual that is database test instance obvious topic transaction price Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Apple MySQL MariaDB Shulou Technology