1. Advantages and Disadvantages of IndexesAdvantages: fast retrieval, faster grouping and sorting Disadvantages: Occupies storage space and reduces data table modification operations 2. Classification of Indexes
3. Rules for using indexes1. Situations suitable for indexing
2. Situations where indexing is not suitable
3. Index failure
4. SQL about index1. Add index when creating table -- Add an index when creating a table -- INDEX keyword -- myindex Index name you choose yourself -- (username(16)) to which column to add it CREATE TABLE mytable( ID INT NOT NULL, username VARCHAR(16) NOT NULL, INDEX myindex (username(16)) ); 2. Add index after creating table -- Add index -- myindex index name (self-defined) -- mytable table name CREATE INDEX myindex ON mytable(username(16)); or ALTER TABLE mytable ADD INDEX myindex(username); 3 View index -- mytable table name show index FROM mytable; 4. Delete index -- myindex index name (self-defined) -- mytable table name DROP INDEX myindex ON mytable; or ALTER TABLE mytable DROP INDEX myindex; SummarizeThis is the end of this article about the advantages and disadvantages of indexing and the use of rules for advanced MySQL learning. For more relevant MySQL advanced indexing content, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Example of how to modify styles via CSS variables
>>: A brief discussion on the problem of Docker run container being in created state
Application Scenario Taking the background manage...
Table of contents Methods that do not change the ...
As a software developer, you must have a complete...
question The tomcat container was successfully ad...
If you want the entire interface to have a backgr...
Regarding some MySQL specifications, some compani...
Download Nginx image in Docker docker pull nginx ...
Record the installation of two MySQL5.6.35 databa...
Table of contents The basic principle of MySQL ma...
Table of contents Requirement description: Requir...
This article shares the specific code of JavaScri...
Table of contents 1. What is Pinia? 2. Pinia is e...
For record, it may be used in the future, and fri...
//MySQL statement SELECT * FROM `MyTable` WHERE `...
CentOS7 is used here, and the kernel version is [...