Home > Article > WeChat Applet > Recommended 10 commonly used clustering index sorting methods, welcome to download!
Why should the mysiam engine be used when executing a lot of selects? Especially when there is an index, this chapter relies on a practical application and analyzes it. 1. Preface: I saw an interesting phenomenon on the Internet. A table with 1W data volume executes different orderby conditions, and the query time is very long. Is this a real problem in practical applications? ? why? 2. Analysis a). Situation description: 1. There is a primary key id and a joint index (id, ver); using the former for orderby query is slow, and using the latter for orderby query will be very fast; 2. The amount of data in each row is quite large 3. ID is the main index, and the field in the select query only has ID, so it is not covered by the index. You don’t need to use the physical disk to return the data. You can get the data you want on the index, but the query should be faster. But slower. Mysql-index coverage b). Analysis: It must not be using the mysiam engine. If so, the speed of query using these two indexes is almost the same, because the address of a physical row is stored in the index, and the actual amount of data occupied Not big. But if it is innodb, it is different. Its main index can be dragged down.
1. Mysql-clustered index slow sorting case analysis
Introduction: Why should the mysiam engine be used when executing a lot of selects? Especially when there is an index. This article relies on a practical application and analyzes it.
【Related Q&A recommendations】:
The above is the detailed content of Recommended 10 commonly used clustering index sorting methods, welcome to download!. For more information, please follow other related articles on the PHP Chinese website!