Home >Java >javaTutorial >How to add index in mybatis
How to add an index in mybatis: First open the data table; then right-click and click the [Design Table] option in the pop-up option list, thus successfully adding a normal index.
1. Click the table, right-click, select Design Table, enter the steps as shown below, and add a normal index:
2. What does the following combined index mean?
The effect of setting both fields as indexes is:
First: uniqueness. That is, for example, when the values of code and pid are 3 and 4, there cannot be another record where the values of code and pid are also 3 and 4
Second: The left side is the main and most important (the leftmost prefix matches in principle). That is, when the field on the left has no value, it seems useless if the field on the right has a value.
The above is the detailed content of How to add index in mybatis. For more information, please follow other related articles on the PHP Chinese website!