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
Grayscale release refers to a release method that...
This article example shares the specific code for...
First download the dependencies yarn add sass-loa...
When a company developer executes an insert state...
Table of contents Preface 1. Why do cross-domain ...
Table of contents 1. Steps 1. Define buttom permi...
The definition and inheritance of classes in JS a...
There are many servers that can host static websi...
Vue methods and properties 1. Methods Usage 1 met...
1. Run fonts, open the font folder, and find the ...
Table of contents Set a not null constraint when ...
1. Check the character set of MySQL show variable...
In cells, dark border colors can be defined indiv...
Table of contents 1. Use in components 2. Option ...
MySQL's foreign key constraint is used to est...